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

j.text.DecimalFormat behavior regarding patterns is not clear

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 22
    • None
    • core-libs
    • b15
    • generic
    • generic

      j.text.DecimalFormat has the method applyPattern(String), which claims that "There is no limit to integer digits set by this routine, since that is the typical end-user desire; use setMaximumInteger if you want to set a real value."

      This claim is not true; if a scientific notation pattern is used, the maximum integer value will be set. If the pattern is in scientific notation, the limit is derived from the pattern, otherwise, the limit is set to Integer.MAX_VALUE. This behavior also applies to the constructors that take String pattern as input. The spec should be clarified.

            jlu Justin Lu
            jlu Justin Lu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: