Difference between revisions of "Template:Deg2HMS/sandbox"

From blackwiki
Jump to navigation Jump to search
imported>Tom.Reding
(The wiki code is entirely too complicated; "|sup=yes" works just fine (I think I just got too near-sighted...).)
 
imported>WOSlinker
(use br instead of p)
 
Line 9: Line 9:
 
For example:<br>
 
For example:<br>
 
<code><nowiki>{{Deg2HMS/sandbox|266.416837|p=4}}</nowiki></code> returns {{Deg2HMS/sandbox|266.416837|p=4}}.
 
<code><nowiki>{{Deg2HMS/sandbox|266.416837|p=4}}</nowiki></code> returns {{Deg2HMS/sandbox|266.416837|p=4}}.
<p>
+
<br><br>
  
 
<code><nowiki>{{Deg2HMS/sandbox|266.416837|p=4|sup=yes}}</nowiki></code> returns {{Deg2HMS/sandbox|266.416837|p=4|sup=yes}}.<br>
 
<code><nowiki>{{Deg2HMS/sandbox|266.416837|p=4|sup=yes}}</nowiki></code> returns {{Deg2HMS/sandbox|266.416837|p=4|sup=yes}}.<br>
 
<code><nowiki>{{Deg2HMS/sandbox|266.416837|p=4|sup=1}}</nowiki></code> returns {{Deg2HMS/sandbox|266.416837|p=4|sup=1}}.<br>
 
<code><nowiki>{{Deg2HMS/sandbox|266.416837|p=4|sup=1}}</nowiki></code> returns {{Deg2HMS/sandbox|266.416837|p=4|sup=1}}.<br>
 
<code><nowiki>{{Deg2HMS/sandbox|266.416837|p=4|sup=42}}</nowiki></code> returns {{Deg2HMS/sandbox|266.416837|p=4|sup=42}}.
 
<code><nowiki>{{Deg2HMS/sandbox|266.416837|p=4|sup=42}}</nowiki></code> returns {{Deg2HMS/sandbox|266.416837|p=4|sup=42}}.
<p>
+
<br><br>
  
 
<code><nowiki>{{Deg2HMS/sandbox|266.416837|p=4|sup=no}}</nowiki></code> returns {{Deg2HMS/sandbox|266.416837|p=4|sup=no}}.<br>
 
<code><nowiki>{{Deg2HMS/sandbox|266.416837|p=4|sup=no}}</nowiki></code> returns {{Deg2HMS/sandbox|266.416837|p=4|sup=no}}.<br>

Latest revision as of 16:04, 20 June 2020

0:0:0

Usage testing

{{Deg2HMS/sandbox|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/sandbox|266.416837|p=4}} returns 17:45:40.0409.

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

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