Convert Degrees
Home Up Convert Degrees Distance & Bearings


  1. The whole units of degrees will remain the same (i.e. in 121.135° longitude, start with 121°).
  2. Multiply the decimal by 60 (i.e. .135 * 60 = 8.1).
  3. The whole number becomes the minutes (8').
  4. Take the remaining decimal and multiply by 60. (i.e. .1 * 60 = 6).
  5. The resulting number becomes the seconds (6"). Seconds can remain as a decimal.
  6. Take your three sets of numbers and put them together, using the symbols for degrees (°), minutes (‘), and seconds (") (i.e. 121°8'6" longitude)

Source Code:

FUNCTION dms
 
LPARAMETERS tnDegrees
 
LOCAL lcDegMinSec, lnDeg, lnMin, lnSec, lnWork

  lnDeg = INT(tnDegrees)
  lnWork = (tnDegrees % lnDeg) * 60
  lnMin =
INT(lnWork)
  lnSec = (lnWork - lnMin) * 60

  lcDegMinSec = ;
    TRANSFORM(lnDeg)+CHR(176)+[ ]+;
    TRANSFORM(lnMin)+[' ]+;
    TRANSFORM(lnSec)+[']

  RETURN lcDegMinSec
ENDFUNC

 

 

 

 

 

 



(c) 1999- jAssing Consulting -- Contact webmaster@jassing.com for problems