A DESCRIPTION OF THE PROBLEM :
Certain languages such as DE, ES, IT, or PT treat the number 1.1 as plural. But JDK returns the long formats in singular form for these cases. E.g., expecting '1,1 millones' for ES but received '1,1 millón' instead.
CLDR Standards:
https://www.unicode.org/cldr/cldr-aux/charts/28/verify/numbers/es.html
https://www.unicode.org/cldr/cldr-aux/charts/28/verify/numbers/de.html
https://www.unicode.org/cldr/cldr-aux/charts/28/verify/numbers/it.html
https://www.unicode.org/cldr/cldr-aux/charts/28/verify/numbers/pt.html
...
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Execute the provided test code to reproduce the error.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
1,1 millones
ACTUAL -
1,1 millón
---------- BEGIN SOURCE ----------
import java.text.NumberFormat;
import java.util.Locale;
public class TestCompactNumberFormat {
public static void main(String[] args) {
NumberFormat fmt = NumberFormat.getCompactNumberInstance(
new Locale("es"), NumberFormat.Style.LONG);
fmt.setMaximumFractionDigits(1);
System.out.println(fmt.format(1_100_000));
}
}
---------- END SOURCE ----------
FREQUENCY : always
Certain languages such as DE, ES, IT, or PT treat the number 1.1 as plural. But JDK returns the long formats in singular form for these cases. E.g., expecting '1,1 millones' for ES but received '1,1 millón' instead.
CLDR Standards:
https://www.unicode.org/cldr/cldr-aux/charts/28/verify/numbers/es.html
https://www.unicode.org/cldr/cldr-aux/charts/28/verify/numbers/de.html
https://www.unicode.org/cldr/cldr-aux/charts/28/verify/numbers/it.html
https://www.unicode.org/cldr/cldr-aux/charts/28/verify/numbers/pt.html
...
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Execute the provided test code to reproduce the error.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
1,1 millones
ACTUAL -
1,1 millón
---------- BEGIN SOURCE ----------
import java.text.NumberFormat;
import java.util.Locale;
public class TestCompactNumberFormat {
public static void main(String[] args) {
NumberFormat fmt = NumberFormat.getCompactNumberInstance(
new Locale("es"), NumberFormat.Style.LONG);
fmt.setMaximumFractionDigits(1);
System.out.println(fmt.format(1_100_000));
}
}
---------- END SOURCE ----------
FREQUENCY : always