how to convert a double into a string
double into a string
Collapse
X
-
Hi,
Here is one way to convert to double to string..
You can always convert the basic type to its class.. like int to Integer, double to Double and then convert it into String using the toString() method.Code:double a= 12.20; Double a1 = new Double(a); String x = a1.toString();
Another way to convert is concatenate the int/double with a string. for example
But remember to trim the space using the trim() method.Code:String a = " " + 12.20;
Hope this will help you out
Thanks and Regards,
-- Abdel Olakara
Comment