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.
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.
- csr for
-
JDK-8314607 j.text.DecimalFormat behavior regarding patterns is not clear
-
- Closed
-
- relates to
-
JDK-6306658 [Fmt-De] DecimalFormat initializes maximumFractionDigits with Integer.MAX_VALUE
-
- Closed
-
-
JDK-4366035 [Fmt-Nu] Doc: DecimalFormat specification is insufficient
-
- Open
-