I hope someone can give me some direction to do the following…
I have GPS NMEA position data that has the Lat and Lon in DDmm.mmmm format. That is, Degrees, minutes, tenths of minutes, hundredths of minutes, thousandths of minutes and Tenthousandths of minutes

The example raw data looks like this:
32 deg 53.5145 min… or 3253.5145 as presented in the Lat NMEA format.

Using the Lat example, I have the collected position data in 3 byte arrays ( LatDeg, LatMin and LatX) in ascii text format.
Example:

My collected data looks like the following

LatDeg[0] = “3”
LatDeg[1] = “2”

LatMin[0]= “5”
LatMin[1]= “3”

LatX[0]= “5”
LatX[1]= “1”
LatX[2]= “4”
LatX[3]= “5”

I need to convert the above data into a format that is Lat in thousandths of minutes, hex format.
The finished result will be sent serially in 6 bytes or two words

To start, I need to convert the LatMin and LatX data into a fraction of the degrees to get the format D.dddddd
To do this, I divide the dddddd by 60 and add it to the degrees. The result is supposed to be 32.8919 degrees.
Then multiply the result by 60 to get the value in minutes… This results in the value of 1973.514 minutes…. then multiply the result by 1000 to get the final value of 1973514 thousandths of minutes. This result will be in decimal if I do the math in decimal, I can serially send the result in a hex format with the Hex serial modifier.
The final output in hex (with the example shown) is 1E1D0A

The first question… How do I convert the format to DD.dddddd ?
…I can get each var byte data in to decimal with the following….

DecWord var word
Temp var byte[5]
I var byte
XX var byte
LatX var byte[5]

Temp[0] = LatX[0]
Temp[1] = LatX[1]
Temp[2] = LatX[2]
Temp[3] = LatX[3]
XX = 3

GOSUB ConvertDec

ConvertDec:
DecWord = 0
FOR I = 0 TO XX
DecWord = DecWord * 10
DecWord = DecWord + Temp[I] – “0”
NEXT I
RETURN

DecWord now contains the decimal value of 5145 for the LatX variable.

I am lost as to how to get to the final results I need. In the final example above, it looks like I need to use 32 bit variables or do the math in some other way to fit it in word size variables….. or do it in smaller parts.
If I am pointed in the correct direction, I think can figure it out….. sorry for the long text…

Thanks,
tcbcats