-
Bug
-
Resolution: Fixed
-
P3
-
13
-
b14
Test jdk: jdk13 build 10
Run following code with CLDR provider(-Djava.locale.providers=CLDR) and default provider:
public static void main(String[] args){
Locale nu_arab = Locale.forLanguageTag("zh-CN-u-nu-arab");
Locale nu_arabext = Locale.forLanguageTag("zh-CN-u-nu-arabext");
Locale nu_th = Locale.forLanguageTag("zh-CN-u-nu-thai");
List<Locale> localeList = List.of(nu_arab, nu_arabext, nu_th);
for (Locale locale: localeList) {
System.out.println("Locale: " + locale);
NumberFormat nf = NumberFormat.getNumberInstance(locale);
System.out.println("Number: " + nf.format(-1234));
NumberFormat cf = NumberFormat.getCurrencyInstance(locale);
System.out.println("Currency: " + cf.format(-1234));
NumberFormat pf = NumberFormat.getPercentInstance(locale);
System.out.println("Percent: " + pf.format(-1234));
}
}
Actual result:
Run with CLDR provider(-Djava.locale.providers=CLDR):
No minus sign before the number with locale zh-CN-u-nu-arab, zh-CN-u-nu-arabext, please refer to attached screenshot.
Expected result:
Should show minus sign before the number.
Run following code with CLDR provider(-Djava.locale.providers=CLDR) and default provider:
public static void main(String[] args){
Locale nu_arab = Locale.forLanguageTag("zh-CN-u-nu-arab");
Locale nu_arabext = Locale.forLanguageTag("zh-CN-u-nu-arabext");
Locale nu_th = Locale.forLanguageTag("zh-CN-u-nu-thai");
List<Locale> localeList = List.of(nu_arab, nu_arabext, nu_th);
for (Locale locale: localeList) {
System.out.println("Locale: " + locale);
NumberFormat nf = NumberFormat.getNumberInstance(locale);
System.out.println("Number: " + nf.format(-1234));
NumberFormat cf = NumberFormat.getCurrencyInstance(locale);
System.out.println("Currency: " + cf.format(-1234));
NumberFormat pf = NumberFormat.getPercentInstance(locale);
System.out.println("Percent: " + pf.format(-1234));
}
}
Actual result:
Run with CLDR provider(-Djava.locale.providers=CLDR):
No minus sign before the number with locale zh-CN-u-nu-arab, zh-CN-u-nu-arabext, please refer to attached screenshot.
Expected result:
Should show minus sign before the number.
- csr for
-
JDK-8220728 With CLDR provider, NumberFormat.format could not handle locale with number extension correctly.
- Closed
- duplicates
-
JDK-8292406 Arabic (Jordan) returns incorrect minus sign
- Closed
- relates to
-
JDK-8220309 MinusSign/Percent/PerMille access methods in DecimalFormatSymbols
- Open