Hi All,
I need to convert a Double value to String.The requirement is as follows
Double do=123456789012 3456.12;
String str=Double.toSt ring(do);
when i execute it i am getting the values in exponential format.
which is like: 1.2345678901234 56E15
But i need the values to be converted exactly into String.I cannot use BigDecimals due to the requirements.
The code is as follows.
public class test1 {
public static void main(String[] args) {
double aDouble = 123456789012345 6.12;
String aString=Double. toString(aDoubl e);
System.out.prin tln(aString1);}
}
Please help me in this regard as it would be help ful for my project completion.
Thanks in Advance!!!
I need to convert a Double value to String.The requirement is as follows
Double do=123456789012 3456.12;
String str=Double.toSt ring(do);
when i execute it i am getting the values in exponential format.
which is like: 1.2345678901234 56E15
But i need the values to be converted exactly into String.I cannot use BigDecimals due to the requirements.
The code is as follows.
public class test1 {
public static void main(String[] args) {
double aDouble = 123456789012345 6.12;
String aString=Double. toString(aDoubl e);
System.out.prin tln(aString1);}
}
Please help me in this regard as it would be help ful for my project completion.
Thanks in Advance!!!
Comment