Template:Deg2HMS/doc

From blackwiki
< Template:Deg2HMS
Revision as of 20:57, 21 November 2014 by imported>Tom.Reding (→‎Usage: Clarifying sup.)
Jump to navigation Jump to search

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 0, or "no". It is activated by either "yes" or any value greater than 0.

For example:
{{Deg2HMS|266.416837|p=4}} returns 17:45:40.0409.

{{Deg2HMS|266.416837|p=4|sup=yes}} returns 17h 45m 40.0409s.
{{Deg2HMS|266.416837|p=4|sup=1}} returns 17h 45m 40.0409s.
{{Deg2HMS|266.416837|p=4|sup=42}} returns 17h 45m 40.0409s.

{{Deg2HMS|266.416837|p=4|sup=no}} returns 17h 45m 40.0409s.
{{Deg2HMS|266.416837|p=4|sup=y}} returns 17h 45m 40.0409s.
{{Deg2HMS|266.416837|p=4|sup=0}} returns 17h 45m 40.0409s.
{{Deg2HMS|266.416837|p=4|sup=huh?}} returns 17h 45m 40.0409s.

See also