Jump to content
Sign in to follow this  
Zedna

dms2dd

Recommended Posts

Zedna

; 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

Share this post


Link to post
Share on other sites
mikeytown2

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.