Difference between revisions of "Template:Deg2HMS"
Jump to navigation
Jump to search
imported>Tom.Reding m (→top) |
imported>Tom.Reding m (→top: Removed the trailing nbsp.) |
||
| Line 1: | Line 1: | ||
| − | {{#expr: FLOOR({{{1|0}}}/15)}}{{#ifexpr: {{#iferror:{{#ifexpr:{{{sup|0}}}>0}} | {{#ifeq:{{{sup|}}}|yes|1|0}} | {{#ifexpr:{{{sup|0}}}>0|1|0}}}} |<sup>h</sup> |:}}{{#expr: FLOOR((({{{1|0}}}/15) - FLOOR({{{1|0}}}/15))*60)}}{{#ifexpr: {{#iferror:{{#ifexpr:{{{sup|0}}}>0}} | {{#ifeq:{{{sup|}}}|yes|1|0}} | {{#ifexpr:{{{sup|0}}}>0|1|0}}}} |<sup>m</sup> |:}}{{#expr: (((({{{1|0}}}/15)-FLOOR({{{1|0}}}/15))*60) - FLOOR((({{{1|0}}}/15)-FLOOR({{{1|0}}}/15))*60))*60 round {{#if:{{{p|}}}|{{{p|}}}|3}}}}{{#ifexpr: {{#iferror:{{#ifexpr:{{{sup|0}}}>0}} | {{#ifeq:{{{sup|}}}|yes|1|0}} | {{#ifexpr:{{{sup|0}}}>0|1|0}}}} |<sup>s</sup> | + | {{#expr: FLOOR({{{1|0}}}/15)}}{{#ifexpr: {{#iferror:{{#ifexpr:{{{sup|0}}}>0}} | {{#ifeq:{{{sup|}}}|yes|1|0}} | {{#ifexpr:{{{sup|0}}}>0|1|0}}}} |<sup>h</sup> |:}}{{#expr: FLOOR((({{{1|0}}}/15) - FLOOR({{{1|0}}}/15))*60)}}{{#ifexpr: {{#iferror:{{#ifexpr:{{{sup|0}}}>0}} | {{#ifeq:{{{sup|}}}|yes|1|0}} | {{#ifexpr:{{{sup|0}}}>0|1|0}}}} |<sup>m</sup> |:}}{{#expr: (((({{{1|0}}}/15)-FLOOR({{{1|0}}}/15))*60) - FLOOR((({{{1|0}}}/15)-FLOOR({{{1|0}}}/15))*60))*60 round {{#if:{{{p|}}}|{{{p|}}}|3}}}}{{#ifexpr: {{#iferror:{{#ifexpr:{{{sup|0}}}>0}} | {{#ifeq:{{{sup|}}}|yes|1|0}} | {{#ifexpr:{{{sup|0}}}>0|1|0}}}} |<sup>s</sup>|}}<noinclude> |
{{documentation}} | {{documentation}} | ||
</noinclude> | </noinclude> | ||
Revision as of 15:45, 21 November 2014
0:0:0
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 17:45:40.0409.
{{Deg2HMS|266.416837|p=4|sup=no}} returns 17:45:40.0409.
See also
| The above documentation is transcluded from Template:Deg2HMS/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |