Jump to content

dms2dd


Zedna
 Share

Recommended Posts

; 49°3'17.843" --> 49.05495639
Func dms2dd($dms)
    $hh = StringSplit($dms, '°') ; 49°3'17.843"
    $mm = StringSplit($hh[2], "'") ; 3'17.843"
    $ss = StringSplit($mm[2], '"') ; 17.843"

    ; $hh[1]=49  $mm[1]=3  $ss[1]=17.843
    Return $hh[1] + $mm[1]/60 + $ss[1]/3600
EndFunc

It could be used for conversion of GPS or time (HH:MM:SS) to decimal numbers.

Note: Whole hours must be given also with minutes and seconds like that: ; 49°0'0" --> 49.0

Edited by Zedna
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...