My GPS module is providing latitude and longitude in a form that needs to be changed. It is giving Degrees, Minutes, and fractions of Minutes. It is giving something similar to this:
3045.7834
I would like to change the Minutes into fractions of Degrees:
30.757834
Is there a simple way to alter the 3rd and 4th digits to put it into this form?
Is there a decimal point missing in the first example?
Are these strings?
If they are strings, you can use strtok to parse the string to get the degrees token, the minutes token and the minute fraction token. Then, use atoi to convert the tokens to numbers, and process the numbers as you wish.
No, there is no decimal point missing. I am using strtok to parse the whole nmea string as you helped me with before. Since the latitude and longitude are strings before I convert them, I can just pull out the second two digits by using their index I believe.