0
Double convert
how to get value after , 45,7 get number 7 or 45,8 get number 8
6 Answers
+ 6
s.substring(s.indexOf(',') + 1)
where s is a string containing 45,7 or 45,8 etc.
+ 5
Rian Pratama Just replace ( , ) with ( . ) in the code snippet above.
s.substring(s.indexOf('.') + 1)
To convert from String to double, you can use
Double.valueOf(s)
For vice versa (double to String)
String.valueOf(d)
where d is a variable of type double.
If you want to remove the dot ( . ), replace it.
s = s.replace(".", "");
+ 2
work, thanks you very much
0
sorry, how to remove .
I covert to double
0
( . )
0
thanks you very much Master.