12-14-2012 02:15 AM
I need to set the string value to the editfied. So I want to convert the float value (with exponent) to string.
So i used Formatter api to handle the exponent and convert to string by the following code.
Formatter formatter = new Formatter("en");
But in my requirement i need to pass '0' as decimal value. So when i pass the the decimal value as '0', then the applicaiton is crashing again (illegalargument exception). Because formatter accepts decimal value as 1 to 15 and not as '0'. But i want to use '0' as decimal value.
Can anybody let me know that anyother way to solve this issue?
12-14-2012 03:59 AM
12-19-2012 06:37 PM - edited 12-19-2012 06:38 PM
double value = 0.0;
Formatter fmt = new Formatter("en");
you will get 0.00 as a String