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.
- csr of
-
JDK-8231984 Clarify semantics of DecimalFormat.getGroupingSize(0)
- Resolved