Difference between revisions of "Template:HMS2Deg/doc"

From blackwiki
Jump to navigation Jump to search
imported>Tom.Reding
(Not a good choice for {{tlc}}; it doesn't display the value of p used. Replaced with <code><nowiki> etc.)
imported>Tom.Reding
(Cleaned up, wikified, removed "Deg2HMS" typos, corrected which values are optional and added examples.)
Line 2: Line 2:
 
<!-- Categories go at the bottom of this page and interwikis go in Wikidata. -->
 
<!-- Categories go at the bottom of this page and interwikis go in Wikidata. -->
  
 +
== Description ==
 +
This template converts an [[hour angle]], given in ''hours'':''minutes'':''seconds'' format, to [[decimal degrees]].
 
== Usage ==
 
== Usage ==
 +
<code><nowiki>{{HMS2Deg|</nowiki>''hours''<nowiki>|</nowiki>''minutes''<nowiki>|</nowiki>''seconds''<nowiki>|p=</nowiki>''precision''<nowiki>}}</nowiki></code>.<br>
  
Usage: {{tlc|HMS2Deg|hours|minutes|seconds| 5=p=precision}}.
+
''Minutes'', ''seconds'', and parameter '''p''' are all optional and default to 0, 0, and 6, respectively.
  
This template converts an [[hour angle]], given in hours|minutes|seconds, to decimal degrees.
+
For example:<br>
  
So <code><nowiki>{{Deg2HMS|HMS2Deg|12|29|06.7|p=5}}</nowiki></code> returns {{HMS2Deg|12|29|06.7|p=5}}.
+
<code><nowiki>{{HMS2Deg|12|29|06.7|p=5}}</nowiki></code> returns {{HMS2Deg|12|29|06.7|p=5}}.<br>
 
+
<code><nowiki>{{HMS2Deg|12|p=5}}</nowiki></code> returns {{HMS2Deg|12|p=5}}.<br>
 
+
<code><nowiki>{{HMS2Deg|12}}</nowiki></code> returns {{HMS2Deg|12}}.
Only parameter '''p''' is optional (defaults to 6).
 
  
 
==See also==
 
==See also==

Revision as of 16:51, 21 November 2014

Description

This template converts an hour angle, given in hours:minutes:seconds format, to decimal degrees.

Usage

{{HMS2Deg|hours|minutes|seconds|p=precision}}.

Minutes, seconds, and parameter p are all optional and default to 0, 0, and 6, respectively.

For example:

{{HMS2Deg|12|29|06.7|p=5}} returns 187.27792.
{{HMS2Deg|12|p=5}} returns 180.
{{HMS2Deg|12}} returns 180.

See also