Showing results for 
Search instead for 
Did you mean: 

Extracting specific decimal places from a decimal number (GPS NMEA data)

Go to solution

Hi all,

Wondering if you could give me some assistance please. I am fairly new to LabVIEW. 


Basically I have been given two seperate VIs, one which acquires NMEA GPS data from my GPS receiver and outputs it in the form, Latitude: ddmm.mmmm and longitude: dddmm.mmmm. The other is a VI which allows input of latitude and longitude in the form required by google maps, which then displays the position on an embedded map.


An example of the nmea data received from my gps receiver is the following: lat: 5227.2143, long: -00155.6721. What I need to do for the latitude is keep the first two digits exactly the same (as the dd part of the output) and then divide the rest of the number by 60 to get it in the form mm.mmmm. So I would get a value of 52.(27.2143/60) which gives 52.45357. The longitude is calculated in a similar way, except that there is an extra digit which is not included in the division due to the fact that it has the format dddmm.mmmm instead of ddmm.mmmm. Therefore the longitude value is -1.92786.


Sorry if I did not explain this well but it is hard to explain. So basically I can calculate it all fine myself, but the problem I am having is finding a way in LabVIEW of taking the specific decimal places from the original numbers and then dividing them by 60 without affecting the characters which I need to leave unchanged, and then to put them back together as a single number with a decimal place in the right place. This can then be put into the google maps search box and the location shown correctly.


Thanks in advance for any advice, 

0 Kudos
Message 1 of 4
Accepted by w.driscoll90

Something like this?

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 4

that looks fantastic, thanks very much for your quick response! I will try it out right now.

0 Kudos
Message 3 of 4

you are simply awesome. I was working on it for a week until I found this solution. 😄 thanks 

0 Kudos
Message 4 of 4