Results 1 to 3 of 3
Thread: String to number problem
Feb 22, 2011, 03:00 #1
String to number problem
I am having an issue with converting a set of coordinates from a string to a number.
The string I receive after I receive them from the json string is formatted like this "(-28.45417, 153.33635)" that's every thing inside the quotation marks including brackets.
So I tried spitting the string at the "," and then Farray=parseFloat()
then on the Farray and Farray
It appears Farray still works out to be NaN though parseFloat() did get the correct longitude which is Farray.
Can anyone see how I get the Farray to be a number?
Feb 22, 2011, 08:14 #2
- Join Date
- Sep 2006
- 0 Post(s)
- 0 Thread(s)
Feb 24, 2011, 17:23 #3
Thanks I solved this by using PHP before the coods were sent :
$coords = trim($coords, "(..)");