-
Bug
-
Resolution: Fixed
-
P3
-
13, 17, 18, 19
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8286222 | 18u-cpu | Ravi Reddy | P3 | Resolved | Fixed | master |
JDK-8284721 | 18.0.2 | Ravi Reddy | P3 | Resolved | Fixed | b06 |
JDK-8285648 | 17.0.5-oracle | Ravi Reddy | P3 | Resolved | Fixed | b01 |
JDK-8284722 | 17.0.4-oracle | Ravi Reddy | P3 | Resolved | Fixed | b05 |
JDK-8286310 | 17.0.4 | Martin Doerr | P3 | Resolved | Fixed | b02 |
JDK-8288104 | 15.0.8 | Yuri Nesterenko | P3 | Resolved | Fixed | b03 |
NumberFormat.getCurrencyInstance().format(x) use the wrong decimal point for locale fr_CH. The localized pattern show that it have the right decimal point but it does not use for formatting. Instead of the expected comma there is a point.
REGRESSION : Last worked in version 11
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Java Version: 11.0.11+9
Currency: -1 234,12 CHF with pattern: # ##0,00' '¤
Number: -1 234,125 with pattern: # ##0,###
ACTUAL -
Java Version: 17.0.2+8-LTS-86
Currency: -1 234.12 CHF with pattern: # ##0,00 ¤
Number: -1 234,125 with pattern: # ##0,###
---------- BEGIN SOURCE ----------
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Locale;
public class CurrencyFormatTest {
public static void main( String[] args ) {
System.err.println( "Java Version: " + System.getProperty( "java.vm.version" ) );
Locale locale = new Locale( "fr", "CH" );
NumberFormat javaFormat = NumberFormat.getCurrencyInstance( locale );
String str = javaFormat.format( -1234.125 );
System.err.println( "Currency: " + str + " with pattern: " + ((DecimalFormat)javaFormat).toLocalizedPattern());
javaFormat = NumberFormat.getNumberInstance( locale );
str = javaFormat.format( -1234.125 );
System.err.println( "Number: " + str + " with pattern: " + ((DecimalFormat)javaFormat).toLocalizedPattern());
}
}
---------- END SOURCE ----------
FREQUENCY : always
- backported by
-
JDK-8284721 Localized monetary symbols are not reflected in `toLocalizedPattern` return value
- Resolved
-
JDK-8284722 Localized monetary symbols are not reflected in `toLocalizedPattern` return value
- Resolved
-
JDK-8285648 Localized monetary symbols are not reflected in `toLocalizedPattern` return value
- Resolved
-
JDK-8286222 Localized monetary symbols are not reflected in `toLocalizedPattern` return value
- Resolved
-
JDK-8286310 Localized monetary symbols are not reflected in `toLocalizedPattern` return value
- Resolved
-
JDK-8288104 Localized monetary symbols are not reflected in `toLocalizedPattern` return value
- Resolved
- links to
-
Commit openjdk/jdk15u-dev/2cfbdffb
-
Commit openjdk/jdk17u-dev/e5a71d77
-
Commit openjdk/jdk18u/8a2234fc
-
Commit openjdk/jdk/c96085ea
-
Review openjdk/jdk15u-dev/218
-
Review openjdk/jdk17u-dev/383
-
Review openjdk/jdk18u/100
-
Review openjdk/jdk/7790