We're updating the issue view to help you get more done. 

DecimalFormat methods setMaximumIntegerDigits and setMinimumIntegerDigits no longer re-set each other

Description

Previously, when setting maximum integer digits to a value smaller than minimum integer digits, the mimimum integer digits would be set to the same value.

Similar logic applied when setting the minimum integer digits to a value bigger than the maximum integer digits.

Since ICU 59 this logic seems to no longer apply entirely. While the values returned by the respective getters seem to represent the values as before, the actually applied values don't seem to agree.

This JUnit test passes on ICU 58 and fails with 59:

1 2 3 4 5 6 7 8 9 10 11 @Test public void test_DecimalFormat_setMaximumIntegerDigits() { DecimalFormat format = (DecimalFormat) DecimalFormat.getInstance(); format.setMinimumIntegerDigits(3); format.setMaximumIntegerDigits(2); assertEquals(2, format.getMaximumIntegerDigits()); // java.util.DecimalFormat.setMaximumIntegerDigits is documented to adapt minimum integer // digits if its value is smaller than the new minimum. assertEquals(2, format.getMinimumIntegerDigits()); assertEquals("01", format.format(1)); }

Note that the old behaviour is documented in the ICU NumberFormat class.

Status

Assignee

Shane Carr

Reporter

TracBot

Components

Fix versions

Priority

major