-
Bug
-
Resolution: Fixed
-
P4
-
1.1.6, 1.2.0
-
b01
-
generic, x86, sparc
-
generic, solaris_2.5, windows_95, windows_nt
-
Not verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2020374 | 1.2.0 | Alan Liu | P4 | Resolved | Fixed | 1.2fcs |
Name: el35337 Date: 05/01/98
import java.text.*;
/*
JDK 1.1.6 Bug, did NOT occur in 1.1.5
Possibly related to bug 4125885.
This class demonstrates a regression in version 1.1.6
of DecimalFormat class.
1.1.6 Results
Value 1.2 Format #.00 Result '01.20' !!!wrong
Value 1.2 Format 0.00 Result '001.20' !!!wrong
Value 1.2 Format 00.00 Result '0001.20' !!!wrong
Value 1.2 Format #0.0# Result '1.2'
Value 1.2 Format #0.00 Result '001.20' !!!wrong
1.1.5 Results
Value 1.2 Format #.00 Result '1.20'
Value 1.2 Format 0.00 Result '1.20'
Value 1.2 Format 00.00 Result '01.20'
Value 1.2 Format #0.0# Result '1.2'
Value 1.2 Format #0.00 Result '1.20'
*/
public class JDK116Bug
{
public static void main(String[] args)
{
show(1.2, "#.00");
show(1.2, "0.00");
show(1.2, "00.00");
show(1.2, "#0.0#");
show(1.2, "#0.00");
}
private static void show(double d, String s)
{
String result = new DecimalFormat(s).format(d);
System.out.println("Value " + d + " Format " + s
+ " Result '" + result + "'");
}
}
(Review ID: 29357)
======================================================================
- backported by
-
JDK-2020374 DecimalFormat bug added in 1.1.6
-
- Resolved
-
- duplicates
-
JDK-4133597 DecimalFormat broken in 1.1.6 -- adds 2 preceeding 0's to format pattern
-
- Closed
-
-
JDK-4139344 java.text.DecimalFormat.applyPattern doesn't set minimum integer digits
-
- Closed
-
-
JDK-4147295 java.text.DecimalFormat.applyPattern doesn't set minimum integer digits
-
- Closed
-
-
JDK-4156602 DecimalFormat: incorrect minimum integer digits for patterns like "#.#"
-
- Closed
-
-
JDK-4136037 Incorrect output from DecimalFormat(###0.0) in 1.1.6
-
- Closed
-
-
JDK-4139452 Using Symantec JIT: NumberFormat, DecimalFormat display leading zeros.
-
- Closed
-