-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.1.4
-
sparc
-
solaris_2.5
Name: dfC67450 Date: 11/27/97
java.text.DecimalFormat.parse(String str, ParsePosition pp) parses
wrong if zeroDigit field of DecimalFormatSymbols field is not set to 0.
Here is the test demonstrating the bug:
-----------------TestPZ.java------------------------
import java.text.*;
public class TestPZ {
public static void main (String args[]){
DecimalFormat df = new DecimalFormat();
DecimalFormatSymbols dfs = df.getDecimalFormatSymbols();
dfs.setZeroDigit('Z');
df.setDecimalFormatSymbols(dfs);
String str = "Z1";
ParsePosition pp = new ParsePosition(0);
System.out.println(str + " parses as " + df.parse(str, pp));
}
}
---------Output from the test---------------------
Z1 parses as 0
--------------------------------------------------
======================================================================
- duplicates
-
JDK-4089422 java.text.DecimalFormat.format() fails when zeroDigit is not set to 0
- Closed