-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
8u25
-
x86_64
-
windows_7
FULL PRODUCT VERSION :
Java(TM) SE Runtime Environment (build 1.8.0_25-b18)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
With 7u51 the number 0.0049 has been rounded to 0.005 using RoundingMode.HALF_UP, with 8u25 it is rounded to 0.004
REGRESSION. Last worked in version 7u51
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
"0.005"
ACTUAL -
"0.004"
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
Locale.setDefault(Locale.US);
DecimalFormat decimalFormat = new DecimalFormat("0.000");
decimalFormat.setRoundingMode(RoundingMode.HALF_UP);
System.out.println(decimalFormat.format(0.0049));
---------- END SOURCE ----------
Java(TM) SE Runtime Environment (build 1.8.0_25-b18)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
With 7u51 the number 0.0049 has been rounded to 0.005 using RoundingMode.HALF_UP, with 8u25 it is rounded to 0.004
REGRESSION. Last worked in version 7u51
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
"0.005"
ACTUAL -
"0.004"
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
Locale.setDefault(Locale.US);
DecimalFormat decimalFormat = new DecimalFormat("0.000");
decimalFormat.setRoundingMode(RoundingMode.HALF_UP);
System.out.println(decimalFormat.format(0.0049));
---------- END SOURCE ----------
- duplicates
-
JDK-8039915 Wrong NumberFormat.format() HALF_UP rounding when last digit exactly at rounding position greater than 5
-
- Closed
-