XML position data (lat/long)

Been prodding away at a clean way to convert the standard
<String>%((A:GPS POSITION LAT, degrees))%!f!</String>
into something more readable like N45 45'44'' but I learned pretty fast I should have taken more math at highschool. Anybody any help on this?

Mathijs
 

taguilo

Resource contributor
Been prodding away at a clean way to convert the standard
<String>%((A:GPS POSITION LAT, degrees))%!f!</String>
into something more readable like N45 45'44'' but I learned pretty fast I should have taken more math at highschool. Anybody any help on this?

Mathijs
This should work:

<String>%((A:GPS POSITION LAT, degrees) s0 1 % 60 * s1 1 % 60 * sp2 l0 0 >= if{ 'N' } els{ 'S' })%!s!%(l0 int)%!02d! %(l1 int)%!02d!'%(l2)%!02d!''</String>


Tom
 
Top