This high-risk template is indefinitely protected from editing to prevent vandalism.


From Wikibooks, open books for an open world
Jump to navigation Jump to search
Template documentation[view] [edit] [history] [purge]

Given a decimal coordinate, two cardinal directions, and precision, render a coordinate in degrees/minutes/seconds.



Precision codes:

d Degrees (rounded to integer)
d1 Degrees (rounded to 0.1 degrees)
dm Degrees, minutes (rounded to integer)
dm1 Degrees, minutes (rounded to 0.1 minutes)
dms Degrees, minutes, seconds (rounded to integer)
dms1 Degrees, minutes, seconds (rounded to 0.1 seconds)


{{Coord/dec2dms|10.391944|N|S|d}} 10°N
{{Coord/dec2dms|10.391944|N|S|d1}} 10.4°N
{{Coord/dec2dms|10.390000|N|S|d}} 10°N
{{Coord/dec2dms|10.390000|N|S|d1}} 10.4°N
{{Coord/dec2dms|10.39|N|S|d}} 10°N
{{Coord/dec2dms|10.39|N|S|d1}} 10.4°N
{{Coord/dec2dms|-10.391944|N|S|dm}} 10°24′S
{{Coord/dec2dms|-10.391944|N|S|dm1}} 10°23.5′S
{{Coord/dec2dms|10.391944|E|W|dms}} 10°23′31″E
{{Coord/dec2dms|10.391944|E|W|dms1}} 10°23′31″E
{{Coord/dec2dms|10|N|S|d}} 10°N
{{Coord/dec2dms|10|E|W|dm}} 10°00′E
{{Coord/dec2dms|-10|E|W|dms}} 10°00′00″W
{{Coord/dec2dms|-10|E|W|dms1}} 10°00′00″W


The following templates are "subroutines" of {{Coord/dec2dms}}. They shouldn't be invoked directly: