<i18n dev> RFR: 4745837: Make grouping usage during parsing apparent in relevant NumberFormat methods [v2]
Justin Lu
jlu at openjdk.org
Thu Feb 27 18:08:36 UTC 2025
On Thu, 27 Feb 2025 16:37:59 GMT, Naoto Sato <naoto at openjdk.org> wrote:
>> Justin Lu has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Naoto review - include strict parsing example. Also remove 'might' wording
>
> 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.
I originally included a strict behavior example as well but reverted it because the default behavior for NumberFormat does not support strict/non-strict. But I think we can include it as long as the wording is careful.
For the formatting example, I inferred that the "might" wording was regarding that there is no guarantee (however unlikely) that `,` remains the grouping separator and a size of 3 for the English locale. That's why I included that wording in the (previous) parsing example.
I changed the wording so that we can remove the ambiguous "might" wording. https://github.com/openjdk/jdk/pull/23813/commits/8c4ff2eb8c1746b524b661f37296cea6586161d9 contains these updates.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23813#discussion_r1974098707
More information about the i18n-dev
mailing list