Am using network provider to get current location lat,long. The code works fine. But the problem is getting latitude as comma separated value(42,44291 instead of 42.44291). I can't show google map using comma separated lat,long. How to solve this problem?
Asked
Active
Viewed 95 times
0
-
Actually this question is really basic. Maybe you should start with plain Java first before you progress to Android Apps. – Willi Mentzel Oct 11 '14 at 12:22
-
possible duplicate: http://stackoverflow.com/questions/6666947/replace-char – Willi Mentzel Oct 11 '14 at 12:26
-
what about replacing comma by dot before showing Google Maps? – Taifun Oct 11 '14 at 14:20
2 Answers
0
You can simply replace the "," with a "." in Java.
String latitudeWithComma = "42,44291";
String latitudeWithDot = latitude.replace(",", ".");

Willi Mentzel
- 27,862
- 20
- 113
- 121
0
String s = "42,44291";
s = s.replaceAll(",",".");
-
-
you see that this question has been answered... why do you post exactly the same 3 minutes after? – Willi Mentzel Oct 11 '14 at 12:27
-
-
replaceAll is nonsense when you only expect one char to be replaced! – Willi Mentzel Oct 11 '14 at 12:30
-
what is your problem man? having a bad day?? lol. walk it off. this question was answered years ago anyway. – durrrr Oct 11 '14 at 12:32
-
-