Difference between revisions of "Template:Deg2HMS/doc"
Jump to navigation
Jump to search
imported>Tom.Reding (Will try to add "h", "m", and "s" superscript capabilities in the future.) |
imported>Vanisaac m (→See also: clean up per WP:CAT#T and WP:AWBREQ add template:Sandbox other) |
||
| (5 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
{{Documentation subpage}} | {{Documentation subpage}} | ||
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> | <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> | ||
| + | == Description == | ||
| + | |||
| + | This template converts a [[decimal degree]] value, typically [[right ascension]], to ''[[Hour angle|hours]]'':''[[Minute and second of arc|minutes]]'':''[[Minute and second of arc|seconds]]'' format or to ''hours''<sup>h</sup> ''minutes''<sup>m</sup> ''seconds''<sup>s</sup> format. | ||
| + | |||
== Usage == | == Usage == | ||
| − | <code><nowiki>{{Deg2HMS|</nowiki>''decimaldegrees''<nowiki>|p=</nowiki>''precision''<nowiki>}}</nowiki></code>. | + | <code><nowiki>{{Deg2HMS|</nowiki>''decimaldegrees''<nowiki>|p=</nowiki>''precision''<nowiki>|sup=</nowiki>''superscripts''<nowiki>}}</nowiki></code>.<br> |
| − | + | Parameter '''p''' is optional and defaults to 3.<br> | |
| + | Parameter '''sup''' is optional and defaults to not-used, <blank>, or <null>. It is activated by "yes", or any text. | ||
| − | <code><nowiki>{{Deg2HMS|266.416837|p=4}}</nowiki></code> returns {{Deg2HMS|266.416837|p=4}}. | + | For example:<br> |
| + | <code><nowiki>{{Deg2HMS|266.416837|p=4}}</nowiki></code> returns {{Deg2HMS|266.416837|p=4}}.<br> | ||
| + | <code><nowiki>{{Deg2HMS|266.416837|p=4|sup= }}</nowiki></code> returns {{Deg2HMS|266.416837|p=4|sup= }}.<br> | ||
| − | + | <code><nowiki>{{Deg2HMS|266.416837|p=4|sup=yes}}</nowiki></code> returns {{Deg2HMS|266.416837|p=4|sup=yes}}.<br> | |
| + | <code><nowiki>{{Deg2HMS|266.416837|p=4|sup=y}}</nowiki></code> returns {{Deg2HMS|266.416837|p=4|sup=y}}.<br> | ||
| + | <code><nowiki>{{Deg2HMS|266.416837|p=4|sup=no}}</nowiki></code> returns {{Deg2HMS|266.416837|p=4|sup=no}}.<br> | ||
==See also== | ==See also== | ||
{{Math templates|conversion}} | {{Math templates|conversion}} | ||
| − | <includeonly>{{ | + | <includeonly>{{Sandbox other|| |
<!-- Categories below this line, please; interwikis at Wikidata --> | <!-- Categories below this line, please; interwikis at Wikidata --> | ||
[[Category:Numerical conversion templates|{{PAGENAME}}]] | [[Category:Numerical conversion templates|{{PAGENAME}}]] | ||
[[Category:Convert-like templates|{{SUBPAGENAME}}]] | [[Category:Convert-like templates|{{SUBPAGENAME}}]] | ||
}}</includeonly> | }}</includeonly> | ||
Latest revision as of 23:12, 24 April 2020
| File:Edit-copy green.svg | This is a documentation subpage for Template:Deg2HMS. It contains usage information, categories and other content that is not part of the original template page. |
Description
This template converts a decimal degree value, typically right ascension, to hours:minutes:seconds format or to hoursh minutesm secondss format.
Usage
{{Deg2HMS|decimaldegrees|p=precision|sup=superscripts}}.
Parameter p is optional and defaults to 3.
Parameter sup is optional and defaults to not-used, <blank>, or <null>. It is activated by "yes", or any text.
For example:
{{Deg2HMS|266.416837|p=4}} returns 17:45:40.0409.
{{Deg2HMS|266.416837|p=4|sup= }} returns 17:45:40.0409.
{{Deg2HMS|266.416837|p=4|sup=yes}} returns 17h 45m 40.0409s.
{{Deg2HMS|266.416837|p=4|sup=y}} returns 17h 45m 40.0409s.
{{Deg2HMS|266.416837|p=4|sup=no}} returns 17h 45m 40.0409s.
See also