Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8214039

The DecimalFormat spec is incorrect about the implicit negative subpattern

    Details

    • Type: CSR
    • Status: Draft
    • Priority: P4
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      source
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      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.
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      The DecimalFormat specification is incorrect about prefixing of localized minus sign to form the implicit negative subpattern

      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</code> pattern contains a positive and negative
       * subpattern, for example, <code>"#,##0.00;(#,##0.00)"</code>.  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>'-'</code> in most locales) is used as the
       * negative subpattern. That is, <code>"0.00"</code> alone is equivalent to
       * <code>"0.00;-0.00"</code>.

      to:

       * <p>A <code>DecimalFormat</code> pattern contains a positive and negative
       * subpattern, for example, <code>"#,##0.00;(#,##0.00)"</code>. 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"</code> alone is equivalent to
       * <code>"0.00;-0.00"</code>.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                naoto Naoto Sato
                Reporter:
                nishjain Nishit Jain (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated: