I have an application that consumes API
. I have no control over that API
, I can only consume it.
The API
returns in JSON
format a name, latitude and longitude.
The problem is that due to a problem, the latitude and longitude returns it in an incorrect format:
[{"Name": "River Side "," Latitude ": - 2524544568.0," Longitude ": - 5758220052.0}]
Obviously, I need Lat and Long to have the following format:
-25.245445680 and -57.582200520
Once I parked the JSON
, and I have every data in a variable, how can I format the latitude and longitude using Javascript
so that they are in the correct format?
Probe toFixed
, but round the number.