Difference between revisions of "Template:DEC"

From blackwiki
Jump to navigation Jump to search
imported>Saintrain
m (Update to also display decimal degrees)
imported>Primefac
m (Changed protection level for "Template:DEC": high-risk template with 4000+ transclusions ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite)))
 
(19 intermediate revisions by 17 users not shown)
Line 1: Line 1:
{{{1}}}&deg;&nbsp;{{{2}}}&prime;{{#iferror:{{#expr:{{{3}}}|&nbsp;|&nbsp;{{{3}}}&Prime;}}}} ({{DMS2Deg| {{{1|0}}}| {{{2|0}}}| {{{3|0}}}| p={{{p|5}}} }}&deg;)<noinclude>
+
{{Str rep|{{{1}}}|-|−}}&deg;{{#ifeq: {{{2|+}}}|{{{2|-}}}|&nbsp;{{{2|}}}&prime;|}}{{#ifeq: {{{3|+}}}|{{{3|-}}}|&nbsp;{{{3|}}}&Prime;|}}<noinclude>
 
+
{{documentation}}
Usage: {{tlc|DEC|degrees|minutes|seconds| 5=p=precision}}.
 
 
 
Formats a [[declination]] angle (expressed in degrees, minutes and seconds), and in decimal degrees.
 
 
 
So {{tlc|DEC|+02|03|09 |5=p=5}} displays as {{DEC|+02|03|09| p=5}} <br>
 
and {{tlc|DEC|+02|03}} displays as {{DEC|+02|03}}  
 
 
 
The third parameter, '''seconds''', is optional. <br>
 
The optional fourth parameter, '''p'''(recision), sets number of decimals to display (defaults to 5).
 
 
 
==See also==
 
* [[template:RA]]
 
 
 
[[Category:Astronomy inline templates|{{PAGENAME}}]]
 
[[Category:Coordinates templates|{{PAGENAME}}]]
 
 
 
[[bg:Шаблон:Делта]]
 
[[de:Vorlage:Deklination]]
 
[[el:Πρότυπο:DEC]]
 
[[fa:الگو:DEC]]
 
[[ja:Template:DEC]]
 
[[sl:Predloga:DEC]]
 
[[vi:Tiêu bản:DEC]]
 
 
</noinclude>
 
</noinclude>

Latest revision as of 16:29, 23 February 2018

Template:Str rep°

Template documentation[view] [edit] [history] [purge]

{{{1}}}° {{{2}}}′ {{{3}}}″

Usage

{{DEC|degrees|minutes|seconds}}

Template:Str rep° minutes′ seconds″

Note that the second and third arguments, seconds & minutes, are optional.

{{DEC|degrees|minutes}}

Template:Str rep° minutes′

{{DEC|degrees}}

Template:Str rep°

When using in tables, leave a space between the | and the {{DEC}}, or else the table will break if the degrees begin with "+".

See also