Difference between revisions of "Template:DEC"

From blackwiki
Jump to navigation Jump to search
(interwiki de)
imported>Saintrain
m (Update to also display decimal degrees)
Line 1: Line 1:
{{{1}}}&deg;{{#ifeq: {{{2|+}}}|{{{2|-}}}|&nbsp;{{{2|}}}&prime;|}}{{#ifeq: {{{3|+}}}|{{{3|-}}}|&nbsp;{{{3|}}}&Prime;|}}<noinclude>
+
{{{1}}}&deg;&nbsp;{{{2}}}&prime;{{#iferror:{{#expr:{{{3}}}|&nbsp;|&nbsp;{{{3}}}&Prime;}}}} ({{DMS2Deg| {{{1|0}}}| {{{2|0}}}| {{{3|0}}}| p={{{p|5}}} }}&deg;)<noinclude>
<nowiki>{{{2}}}</nowiki>&prime;&nbsp;<nowiki>{{{3}}}</nowiki>&Prime;<br><br>
 
  
=Documentation=
+
Usage: {{tlc|DEC|degrees|minutes|seconds| 5=p=precision}}.
<nowiki>{{DEC|degrees|minutes|seconds}}</nowiki>
 
:'''{{DEC|degrees|minutes|seconds}}'''
 
  
Note that the second and third arguments, '''seconds''' & '''minutes''', are optional.
+
Formats a [[declination]] angle (expressed in degrees, minutes and seconds), and in decimal degrees.  
  
<nowiki>{{DEC|degrees|minutes}}</nowiki>
+
So {{tlc|DEC|+02|03|09 |5=p=5}} displays as {{DEC|+02|03|09| p=5}} <br>
:'''{{DEC|degrees|minutes}}'''
+
and {{tlc|DEC|+02|03}} displays as {{DEC|+02|03}}  
  
<nowiki>{{DEC|degrees}}</nowiki>
+
The third parameter, '''seconds''', is optional. <br>
:'''{{DEC|degrees}}'''
+
The optional fourth parameter, '''p'''(recision), sets number of decimals to display (defaults to 5).
  
 
==See also==
 
==See also==

Revision as of 22:56, 27 August 2008

{{{1}}}° {{{2}}}′ (0°)

Usage: {{DEC|degrees|minutes|seconds|p=precision}}.

Formats a declination angle (expressed in degrees, minutes and seconds), and in decimal degrees.

So {{DEC|+02|03|09|p=5}} displays as +02° 03′9 (2.0525°)
and {{DEC|+02|03}} displays as +02° 03′ (2.05°)

The third parameter, seconds, is optional.
The optional fourth parameter, p(recision), sets number of decimals to display (defaults to 5).

See also

bg:Шаблон:Делта de:Vorlage:Deklination el:Πρότυπο:DEC fa:الگو:DEC ja:Template:DEC sl:Predloga:DEC vi:Tiêu bản:DEC