|
| |
- The whole units of degrees will remain the same (i.e. in 121.135°
longitude, start with 121°).
- Multiply the decimal by 60 (i.e. .135 * 60 = 8.1).
- The whole number becomes the minutes (8').
- Take the remaining decimal and multiply by 60. (i.e. .1 * 60 = 6).
- The resulting number becomes the seconds (6"). Seconds can remain as a
decimal.
- 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 |
|