Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8363972 Lenient parsing of minus sign pattern in DecimalFormat/CompactNumberFormat
  3. JDK-8366216

Release Note: Lenient parsing of minus sign pattern in DecimalFormat/CompactNumberFormat

XMLWordPrintable

    • generic
    • generic

      `java.text.NumberFormat` now allows implementations to parse the minus sign in negative patterns leniently when in lenient mode (`NumberFormat.isStrict()` returns `false`). The concrete classes, `DecimalFormat` and `CompactNumberFormat` both use CLDR’s `parseLenient` data to support lenient parsing of minus signs, and this behavior is enabled by default. For example, if the text to parse uses the `MINUS SIGN` (U+2212) as the negative prefix, it is now correctly recognized as a minus sign:
      ```
      jshell> NumberFormat.getNumberInstance().parse("\u22123")
      $183 ==> -3
      ```

            naoto Naoto Sato
            naoto Naoto Sato
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: