قالب:Decdeg
![](http://upload.wikimedia.org/wikipedia/commons/thumb/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg/50px-Test_Template_Info-Icon_-_Version_%282%29.svg.png)
Purpose
Provides an easy way to convert geographic coordinates from most formats to Decimal Degrees. It is primarily intended to work as a sub-template when building infoboxes.
Usage
The template can be use with named or unnamed parameters as shown.
Fields | Description |
---|---|
{{decdeg| deg = | min =| sec = | hem = | rnd =}} | DegreesMinutesSecondsHemisphereRound |
{{decdeg|deg|min|sec|hem|rnd}} |
Input degrees can be signed in which case the hemisphere is not required. A negative value implies a value in the western or southern hemisphere. Minutes and seconds need not be specified. If no degrees are specified then a value of zero is assumed. This template does not attempt to trap invalid values and results in this case will be undefined.
If |rnd=
is not specified then the default value is |rnd=7
.
Examples
Wiki markup
{{decdeg| deg = 37| min = 51| sec = 00| hem = N}}, {{decdeg| deg = 119| min = 34| sec = 04| hem = W}}
produces:
37.85,-119.5677778
Wiki markup
{{decdeg| deg = 37| min = 51| hem = N}}, {{decdeg| deg = 119| min = 34| hem = W}}
produces:
37.85,-119.5666667
Wiki markup
{{decdeg| deg = 37| min = 51| sec = 00| rnd = 8}}, {{decdeg| deg = -119| min = 34| sec = 04| rnd = 8}}
produces:
37.85,-119.56777778
Wiki markup
{{decdeg|37|51|00|N}},{{decdeg|119|34|04|W}}
produces:
37.85,-119.5677778
Wiki markup
{{decdeg|37.85}},{{decdeg|-119.5677778}}
produces:
37.85,-119.5677778