Hi,
I try to convert string to double like below:
public class StringToDoubleConverter
{
public static void main(String args[])
{
String str = "24855848.98";
//approach 1: to convert String to double
double d1 = Double.parseDouble(str);
System.out.println( "d1 = " + d1 );
//approach 2: to convert String to double
double d2 = Double.valueOf(str);
System.out.println( "d2 = " + d2 );
}
}
When i see the output the value is
d1 = 2.485584898E7
d2 = 2.485584898E7
instead of 24855848.98
Please suggest me in this. how do i convert it as it is without this hex value.