Difference between revisions of "Template:Decdeg/doc"
imported>Droll (→Examples: simplified presentation style (hopefully)) |
imported>Droll m (→Examples: tiny tidy) |
||
| Line 61: | Line 61: | ||
:<tt><nowiki>{{decdeg|-119.5666667}}</nowiki></tt> → {{decdeg|-119.5666667}} | :<tt><nowiki>{{decdeg|-119.5666667}}</nowiki></tt> → {{decdeg|-119.5666667}} | ||
| − | When using rounding, | + | When using rounding, the factor must be the fifth parameter: |
:<tt><nowiki>{{decdeg|37.85||||1}}</nowiki></tt> → {{decdeg|37.85||||1}} | :<tt><nowiki>{{decdeg|37.85||||1}}</nowiki></tt> → {{decdeg|37.85||||1}} | ||
Revision as of 00:53, 26 July 2010
| 40px | This is a documentation subpage for Template:Decdeg. It contains usage information, categories and other content that is not part of the original template page. |
| This template employs intricate features of template syntax.
You are encouraged to familiarise yourself with its setup and parser functions before editing the template. If your edit causes unexpected problems, please undo it quickly, as this template may appear on a large number of pages. You can conduct experiments, and should test all major changes, in either this template's sandbox, the general template sandbox, or your user space before changing anything here. |
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 =
}}
|
Degrees Minutes Seconds Hemisphere Round |
{{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
- {{decdeg|deg=37|min=51|sec=00|hem=N}} → 37.85
- {{decdeg|deg=119|min=34|sec=04|hem=W}} → -119.5677778
When using unnamed parameters, the hemisphere must be the forth parameter:
- {{decdeg|37|51||N}} → 37.85
- {{decdeg|119|34||W}} → -119.5666667
Input can be signed or unsigned decimal degrees:
- {{decdeg|37.85|||N}} → 37.85
- {{decdeg|119.5666667|||W}} → -119.5666667
- {{decdeg|37.85}} → 37.85
- {{decdeg|-119.5666667}} → -119.5666667
When using rounding, the factor must be the fifth parameter:
- {{decdeg|37.85||||1}} → 37.9
- {{decdeg|-119.5666667||||1}} → -119.6
If a value is undefined then zero is presumed:
- {{decdeg||51||N}} → 0.85
- {{decdeg||34||W}} → -0.5666667
Negative zero values are accommodated:
- {{decdeg|0|51}} → 0.85
- {{decdeg|-0|34}} → -0.5666667
See also