<i18n dev> [14] RFR: 8222756: Plural support in CompactNumberFormat

naoto.sato at oracle.com naoto.sato at oracle.com
Mon Nov 25 21:16:55 UTC 2019


Hello,

CompactNumberFormat has been added since JDK 12 to support compact 
number formatting, such as 10_000 being formatted as "10K." [1] It works 
fine for English, however, not for other languages that take plural 
forms in formatted number prefixes/suffixes. In order to fix this, I 
filed the following CSR to extend the current CompactNumberFormat spec:

https://bugs.openjdk.java.net/browse/JDK-8232633

It basically accommodates the plural prefix/suffix forms into the 
existing compact patterns array, so that the existing compact number 
format works compatibly. The plural rules are solely based on the CLDR's 
plural language rules [2]

Here is the implementation of the CSR:

https://cr.openjdk.java.net/~naoto/8222756/webrev.00/

Please review the CSR as well as its implementation.

Naoto


[1] https://bugs.openjdk.java.net/browse/JDK-8177552
[2] https://unicode.org/reports/tr35/tr35-numbers.html#Language_Plural_Rules


More information about the i18n-dev mailing list