On Wed, 26 Feb 2025 22:18:17 GMT, Justin Lu <j...@openjdk.org> wrote:

> Please review this PR which clarifies some behavior regarding NumberFormat 
> grouping specifically in the grouping related methods.
> 
> Please see the corresponding CSR for further detail. Note that an alternative 
> would be to specify this at the DecimalFormat level, allowing NumberFormat 
> subclasses to define this behavior how they want. IMO, I would expect 
> `setGroupingUsed(boolean)` to affect both; a subclass could define 
> `(is|set)(Parsing|Formatting)GroupingUsed` if need be, thus the proposed 
> solution.

src/java.base/share/classes/java/text/NumberFormat.java line 889:

> 887:      * formatting and parsing. For example, in the English locale, with 
> grouping on,
> 888:      * the number 1234567 might be formatted as "1,234,567". For the 
> same format
> 889:      * with grouping off, the String "1,234,567" might be parsed as 1.

Although you used `might`, it may be helpful to mention the leniency here. I 
think it will throw exception in the strict mode.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/23813#discussion_r1973958774

Reply via email to