Hi,
I have a small program which I need to display double values with System.out.println.
public class SmallNumber
{
public static void main(String args[])
{
Double double1 = new Double(0.0001);
Double double2 = new Double(0.001);
System.out.println(double1 );//Prints 1.0E-4
System.out.println(double2 );//Prints 0.0010
}
}
Why does java print double value (0.0001) in scientific notation(1.0E-4). Is there a way that I can print 0.0001 as it is.
Thanks,
Chamal.