-
Type:
CSR
-
Resolution: Approved
-
Priority:
P4
-
Component/s: core-libs
-
None
-
minimal
-
The compatibility risk is minimum as the implementation correctly uses ASCII minus sign ('-' U+002D) to form implicit negative subpattern, irrespective of the mention of "localized minus sign" in the specification.
-
Java API
-
SE
Summary
Correction to the spec of implicit negative subpattern in DecimalFormat
Problem
The DecimalFormat pattern contains positive and optional negative subpattern separated by ';' (For example, "#,##0.00;(#,##0.00)"), if negative subpattern is missing, then the positive pattern prefixed by the ASCII minus sign ('-' U+002D HYPHEN-MINUS) is used, which is incorrectly mentioned as "localized minus sign" in the specification.
Solution
Update the DecimalFormat specification to correctly mention the use of ASCII minus sign ('-' U+002D HYPHEN-MINUS) instead of "localized minus sign" for the implicit negative subpattern.
Specification
Update the DecimalFormat specification
from:
* <p>A {@code DecimalFormat} pattern contains a positive and negative
* subpattern, for example, {@code "#,##0.00;(#,##0.00)"}. Each
* subpattern has a prefix, numeric part, and suffix. The negative subpattern
* is optional; if absent, then the positive subpattern prefixed with the
* localized minus sign ({@code '-'} in most locales) is used as the
* negative subpattern. That is, {@code "0.00"} alone is equivalent to
* {@code "0.00;-0.00"}.
to:
* <p>A {@code DecimalFormat} pattern contains a positive and negative
* subpattern, for example, {@code "#,##0.00;(#,##0.00)"}. Each
* subpattern has a prefix, numeric part, and suffix. The negative subpattern
* is optional; if absent, then the positive subpattern prefixed with the
* minus sign ('-' U+002D HYPHEN-MINUS) is used as the
* negative subpattern. That is, {@code "0.00"} alone is equivalent to
* {@code "0.00;-0.00"}.
- csr of
-
JDK-8211449 Correction to the spec of implicit negative subpattern in DecimalFormat
-
- Resolved
-