The following was found as part of RFE 4092330. It is not really related to RFE 4092330 and therefore I am creating this bug for it.
DecimalFormat: A pattern like "##0.000E0" does not produce three fraction digits if the fraction part is close or equal to zero.
I ran the following code below using with 1.6.0 b40 on Solaris 9 and the bug still exists.
Compile and run the code below to see this bug:
---------- BEGIN SOURCE ----------
import java.text.DecimalFormat;
public class DecimalFormatTest {
public static void main(String[] args) {
DecimalFormat df = new DecimalFormat("##0.000E0"); // three fraction digits !
System.out.println(df.format(12345.0)); // "12.345E3", OK
System.out.println(df.format(12000.0)); // "12.00E3", BUG
System.out.println(df.format(12001.0)); // "12.001E3", OK
System.out.println(df.format(12000.3)); // "12.0003E3", BUG
System.out.println(df.format(12000.7)); // "12.0007E3", BUG
System.out.println(df.format(12000.03)); // "12.00E3", BUG
}
}
---------- END SOURCE ----------
###@###.### 2005-06-14 23:34:31 GMT