Difference between revisions of "Template:Decdeg/doc"

From blackwiki
Jump to navigation Jump to search
imported>کاشف عقیل
imported>Droll
(working)
Line 45: Line 45:
 
=== Examples ===
 
=== Examples ===
  
'''Wiki markup'''
+
:<tt><nowiki>{{decdeg|deg=37|min=51|sec=00|hem=N}}</tt></nowiki> {{decdeg|deg=37|min=51|sec=00|hem=N}}
<blockquote style="background: white; border: 1px solid rgb(153, 153, 153); padding: 1em; width:200px;"><pre><nowiki>
+
:<tt><nowiki>{{decdeg|deg=119|min=34|sec=04|hem=W}}</tt></nowiki> → {{decdeg|deg=119|min=34|sec=04|hem=W}}
{{decdeg
+
 
| deg = 37
+
 
| min = 51
 
| sec = 00
 
| hem = N
 
}},
 
{{decdeg
 
| deg = 119
 
| min = 34
 
| sec = 04
 
| hem = W
 
}}
 
 
</nowiki></pre></blockquote>
 
</nowiki></pre></blockquote>
 
'''produces:'''
 
'''produces:'''

Revision as of 23:47, 25 July 2010

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}}</tt> → 37.85
{{decdeg|deg=119|min=34|sec=04|hem=W}}</tt> → -119.5677778


</nowiki>

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


See also