Name: avC70361 Date: 12/29/97
The java.text.DecimalFormat.applyPattern(String pattern) doesn't set minimum
integer digits correctly. For example, when applying "#,##0" pattern minimum
integer digits should be equal to 1, but getMinimumIntegerDigits() returns 0.
Here is the test demonstrating the bug.
---------Test.java------------------------
import java.text.*;
public class Test {
public static void main (String args[]){
DecimalFormat sdf = new DecimalFormat();
String pattern = "#,##0";
System.out.println("Applying pattern " + pattern);
sdf.applyPattern(pattern);
System.out.println("Minimum integer digits : " +sdf.getMinimumIntegerDigits());
System.out.println("Pattern :" + sdf.toPattern());
}
}
----------The output from the test--------
#> java Test
Applying pattern #,##0
Minimum integer digits : 0
Pattern :#,###
------------------------------------------
======================================================================