0

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?

Gayathiri
  • 427
  • 1
  • 4
  • 9

2 Answers2

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(",",".");

As already answered here

Community
  • 1
  • 1
durrrr
  • 352
  • 2
  • 15