RFR: 8281317: CompactNumberFormat displays 4-digit values when rounding to a new range

Joe Wang joehw at openjdk.java.net
Tue Feb 15 22:03:05 UTC 2022


On Wed, 9 Feb 2022 22:37:45 GMT, Naoto Sato <naoto at openjdk.org> wrote:

> Fixing an issue in `CompactNumberFormat` which was caused by BigDecimal.divide() that incremented the number in the resulting format string. Also fixing some typos by taking this opportunity.

src/java.base/share/classes/java/text/CompactNumberFormat.java line 595:

> 593:                 divisor = (Long) divisors.get(++compactDataIndex);
> 594:                 iPart = getIntegerPart(number, divisor);
> 595:             }

This and the few lines surrounding it were duplicated. Might be worth considering consolidation.

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

PR: https://git.openjdk.java.net/jdk/pull/7412


More information about the core-libs-dev mailing list