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

Clarify semantics of DecimalFormat.getGroupingSize(0)

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 14
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Risk is minimal, as this is just to clarify the spec.
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      Clarify the semantics of grouping size of zero in java.text.DecimalFormat class

      Problem

      It is unclear how grouping size zero affects the formatting from the current spec.

      Solution

      Clarify the validity of size zero in get/setGroupingSize() method descriptions.

      Specification

      Add the following sentence in the first paragraph in get/setGroupingSize() methods.

      -     * in the number "123,456.78", the grouping size is 3.
      -     * <br>
      +     * in the number "123,456.78", the grouping size is 3. Grouping size of
      +     * zero designates that grouping is not used, which provides the same
      +     * formatting as if calling {@link #setGroupingUsed(boolean)
      +     * setGroupingUsed(false)}.
      +     * <p>

      Modify the description of the serial field groupingSize as follows:

            * The number of digits between grouping separators in the integer
      -     * portion of a number.  Must be equal to, or greater than 0 if
      +     * portion of a number.  Must not be negative or greater than
      +     * {@link java.lang.Byte#MAX_VALUE Byte.MAX_VALUE} if
            * {@code NumberFormat.groupingUsed} is true.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              naoto Naoto Sato
              Reporter:
              darcy Joe Darcy
              Reviewed By:
              Roger Riggs
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: