-
Bug
-
Resolution: Fixed
-
P3
-
17, 18, 19, 20
-
b21
-
generic
-
generic
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8301317 | 17.0.8-oracle | Yoshiki Sato | P3 | Resolved | Fixed | b01 |
JDK-8306296 | 17.0.8 | Goetz Lindenmaier | P3 | Resolved | Fixed | b01 |
A DESCRIPTION OF THE PROBLEM :
Norwegian Nynorsk is a language in Norway: https://www.unicode.org/cldr/cldr-aux/charts/28/summary/nn.html and https://github.com/openjdk/jdk/blob/master/make/data/cldr/common/main/nn.xml
Formatting should be similar to Norwegian Bokmål https://github.com/openjdk/jdk/blob/master/make/data/cldr/common/main/nb.xml
In Java 17, 18 and 19 Norwegian Nynorsk defaults to English formatting when using BigDecimal, Integer and probably other types.
REGRESSION : Last worked in version 11.0.16.1
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Locale;
public class JDKBug {
public static void main(String args[]) {
BigDecimal amount = new BigDecimal("2345.78");
DecimalFormat norwegianNynorskAmountFormatter = getAmountFormatter(new Locale("nn", "NO"));
System.out.println("Nynorsk amount formatting: " + norwegianNynorskAmountFormatter.format(amount));
DecimalFormat norwegianBokmaalAmountFormatter = getAmountFormatter(new Locale("nb", "NO"));
System.out.println("Bokmål amount formatting: " + norwegianBokmaalAmountFormatter.format(amount));
}
private static DecimalFormat getAmountFormatter(Locale locale) {
NumberFormat nf = NumberFormat.getNumberInstance(locale);
return (DecimalFormat) nf;
}
}
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Nynorsk amount formatting: 2 345,78
Bokmål amount formatting: 2 345,78
ACTUAL -
Nynorsk amount formatting: 2,345.78
Bokmål amount formatting: 2 345,78
---------- BEGIN SOURCE ----------
See above source code
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Use Norwegian Bokmål locale for formatting.
FREQUENCY : always
Norwegian Nynorsk is a language in Norway: https://www.unicode.org/cldr/cldr-aux/charts/28/summary/nn.html and https://github.com/openjdk/jdk/blob/master/make/data/cldr/common/main/nn.xml
Formatting should be similar to Norwegian Bokmål https://github.com/openjdk/jdk/blob/master/make/data/cldr/common/main/nb.xml
In Java 17, 18 and 19 Norwegian Nynorsk defaults to English formatting when using BigDecimal, Integer and probably other types.
REGRESSION : Last worked in version 11.0.16.1
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Locale;
public class JDKBug {
public static void main(String args[]) {
BigDecimal amount = new BigDecimal("2345.78");
DecimalFormat norwegianNynorskAmountFormatter = getAmountFormatter(new Locale("nn", "NO"));
System.out.println("Nynorsk amount formatting: " + norwegianNynorskAmountFormatter.format(amount));
DecimalFormat norwegianBokmaalAmountFormatter = getAmountFormatter(new Locale("nb", "NO"));
System.out.println("Bokmål amount formatting: " + norwegianBokmaalAmountFormatter.format(amount));
}
private static DecimalFormat getAmountFormatter(Locale locale) {
NumberFormat nf = NumberFormat.getNumberInstance(locale);
return (DecimalFormat) nf;
}
}
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Nynorsk amount formatting: 2 345,78
Bokmål amount formatting: 2 345,78
ACTUAL -
Nynorsk amount formatting: 2,345.78
Bokmål amount formatting: 2 345,78
---------- BEGIN SOURCE ----------
See above source code
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Use Norwegian Bokmål locale for formatting.
FREQUENCY : always
- backported by
-
JDK-8301317 Norwegian Nynorsk Locale is missing formatting
- Resolved
-
JDK-8306296 Norwegian Nynorsk Locale is missing formatting
- Resolved
- relates to
-
JDK-8258794 Update CLDR to version 39.0
- Resolved
- links to
-
Commit openjdk/jdk17u-dev/9eeb7415
-
Commit openjdk/jdk/b37421e7
-
Review openjdk/jdk17u-dev/1248
-
Review openjdk/jdk/10774
(2 links to)