Wild Plague Wild Plague - 4 months ago 19
Android Question

How to remove decimal point from a double value after converting it to astring

I want to remove a decimal point from a

value. I tried by converting it to string

double intify(double a)
String s=Double.toString(a);
String s2=s.replaceAll(".","");

return a;


If I pass 123.4567 it should return 1234567.


replaceAll replaces a regex. You should use replace instead:

String s2 = s.replace(".","");