-
Bug
-
Resolution: Not an Issue
-
P4
-
8, 9
-
generic
-
generic
DecimalFormat.format(double/float, ...) 'multiplier' attribute is implemented by doing multiply and divide operations like :
- passedValue * multiplier
- passedValue / multiplier
That introduces floating-point errors on the value to be formatted.
This is not impacting as long as the initial value is far enough from the tie when considering rounding mode.
When close to tie the error impact the result and brings rounding errors, like rounding down when it should be rounded up.
multiplier attribute should be implemented differently avoid such rounding errors.
- passedValue * multiplier
- passedValue / multiplier
That introduces floating-point errors on the value to be formatted.
This is not impacting as long as the initial value is far enough from the tie when considering rounding mode.
When close to tie the error impact the result and brings rounding errors, like rounding down when it should be rounded up.
multiplier attribute should be implemented differently avoid such rounding errors.
- relates to
-
JDK-8065885 DecimalFormat percentInstance HALF_UP wrong rounding down on doubles greater but close to tie
-
- Closed
-