-
Bug
-
Resolution: Fixed
-
P3
-
8, 9
-
b36
-
generic
-
generic
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8085078 | emb-9 | Brian Burkhalter | P3 | Resolved | Fixed | team |
JDK-8063925 | 8u45 | Brian Burkhalter | P3 | Resolved | Fixed | b01 |
JDK-8061380 | 8u40 | Brian Burkhalter | P3 | Resolved | Fixed | b12 |
JDK-8070008 | emb-8u47 | Brian Burkhalter | P3 | Resolved | Fixed | team |
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) Server VM (build 25.0-b70, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux paris 2.6.32-220.4.1.el6.i686 #1 SMP Mon Feb 6 16:10:45 CET 2012 i686 i686 i386 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
Formating 0.950000550000 to a six fraction digits works properly, I get "0.950001".
Formating 0.950000600000 to a six fraction digits works wrong, I get "0.95" instead of "0.950001".
REGRESSION. Last worked in version 7u51
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
@Test
public void test_roundingOfDoubleValues() {
NumberFormat format = DecimalFormat.getInstance( Locale.US );
format.setGroupingUsed( false );
format.setMaximumFractionDigits( 6 );
format.setRoundingMode( RoundingMode.HALF_UP );
String val95000055 = format.format( 0.950000550000 );
assertEquals( "0.950001", val95000055 ); // this is okay
String val95000060 = format.format( 0.950000600000 );
assertEquals( "0.950001", val95000060 ); // this provides an error
}
---------- END SOURCE ----------
- backported by
-
JDK-8061380 Wrong NumberFormat.format() HALF_UP rounding when last digit exactly at rounding position greater than 5
- Resolved
-
JDK-8063925 Wrong NumberFormat.format() HALF_UP rounding when last digit exactly at rounding position greater than 5
- Resolved
-
JDK-8070008 Wrong NumberFormat.format() HALF_UP rounding when last digit exactly at rounding position greater than 5
- Resolved
-
JDK-8085078 Wrong NumberFormat.format() HALF_UP rounding when last digit exactly at rounding position greater than 5
- Resolved
- duplicates
-
JDK-8041961 DecimalFormat RoundingMode.HALF_UP is broken (HALF_EVEN is OK)
- Closed
-
JDK-8052366 NumberFormat doesn't round correctly in HALF_UP rounding case
- Closed
-
JDK-8064756 java.text.DecimalFormat ROUND_UP formatting no longer works in Java 8
- Closed
-
JDK-8064757 Problem with RoundingMode.HALF_UP
- Closed
-
JDK-8152933 Rounding error in NumberFormat
- Closed
- relates to
-
JDK-8061690 Refactor tests for NumberFormat
- Open
-
JDK-8223946 NumberFormat.format() HALF_UP rounding is incorrect: 16.665 -> 16.66
- Closed
-
JDK-7131459 [Fmt-De] DecimalFormat produces wrong format() results when close to a tie
- Closed
-
JDK-8061673 Refactor similar code for rounding mode handling in NumberFormat
- Closed
-
JDK-8062756 Rounding HALF_UP produce wrong text representations
- Closed