Difference between revisions of "Template:Convert/km to mi/doc"

From Teampedia
Jump to: navigation, search
(Created page with "<includeonly>{{FORMATNUM:{{#if:{{{num|}}}|{{{num}}}|{{{1}}}}}}} {{#ifexpr:({{#ifeq:{{LC:{{{abbr|mos}}}}}|mos|1|0}} OR {{#ifeq:{{LC:{{{abbr|mos}}}}}|no|1|0}})|{{#ifeq:{{LC...")
 
 
Line 1: Line 1:
<includeonly>{{FORMATNUM:{{#if:{{{num|}}}|{{{num}}}|{{{1}}}}}}}&nbsp;{{#ifexpr:({{#ifeq:{{LC:{{{abbr|mos}}}}}|mos|1|0}} OR {{#ifeq:{{LC:{{{abbr|mos}}}}}|no|1|0}})|{{#ifeq:{{LC:{{{spell|american}}}}}|american|{{#ifeq:{{LC:{{{wiki|no}}}}}|yes|[[w:kilometre|kilometers]]|kilometers}}|{{#ifeq:{{LC:{{{wiki|no}}}}}|yes|[[w:kilometre|kilometres]]|kilometres}}}}|{{#ifeq:{{LC:{{{wiki|no}}}}}|yes|[[w:kilometre|km]]|km}}}} ({{FORMATNUM:{{#expr:{{#if:{{{num|}}}|{{{num}}}|{{{1}}}}}/1.609344 round {{{precision|0}}}}}}}&nbsp;{{#ifeq:{{LC:{{{abbr|mos}}}}}|no|{{#ifeq:{{LC:{{{wiki|no}}}}}|yes|[[w:mile|miles]]|miles}}|{{#ifeq:{{LC:{{{wiki|no}}}}}|yes|[[w:mile|mi]]|mi}}}})</includeonly><noinclude>{{documentation}}[[Category:Conversion templates|{{PAGENAME}}]]</noinclude>
+
{{Documentation subpage}}
 +
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
 +
 
 +
=== Usage ===
 +
:<nowiki>{{convert/km to mi | num | abbr | spell | precision | wiki}}</nowiki>
 +
 
 +
;Examples:
 +
:''[[WP:MOSNUM#Units of measurement|Manual of Style]] notation'': <nowiki>{{convert/km to mi|100}}</nowiki>&nbsp;&rarr; {{convert/km to mi|100}}
 +
:''Short notation'': <nowiki>{{convert/km to mi|100|abbr=yes}}</nowiki>&nbsp;&rarr; {{convert/km to mi|100|abbr=yes}}
 +
:''Full notation'': <nowiki>{{convert/km to mi|num=100|abbr=no|spell=Commonwealth|precision=2|wiki=yes}}</nowiki>&nbsp;&rarr; {{convert/km to mi|num=100|abbr=no|spell=Commonwealth|precision=2|wiki=yes}}
 +
 
 +
''Italicized'' parameters are optional:
 +
*'''num''' is a required parameter, which specifies the number of kilometers to be converted to miles.  Please do not format this parameter; i.e., use 1234 instead of 1,234.
 +
*'''''abbr''''' can take values of either ''mos'', ''yes'', or ''no''.  ''Mos'' will show the names of the units as specified in the [[WP:MOSNUM#Units of measurement|Manual of Style for dates and numbers]] (kilometers, mi); ''yes'' will show the abbreviated names of the units (km, mi); and ''no'' will show the full names of the units (kilometers, miles).  The default value is ''mos''.
 +
*'''''spell''''' can take values of ''American'' or ''Commonwealth'' and is only meaningful when ''abbr'' is set to ''no''.  ''American'' will use "kilometers", and ''Commonwealth''&mdash;"kilometres".  The default value is ''American''.
 +
*'''''precision''''' is the number of decimal digits in the converted value.  The default value is&nbsp;0.
 +
*'''''wiki''''' specifies whether the names of the units should be wikified or not and can take values of either ''yes'' or ''no''. The default value is ''no''.
 +
 
 +
Capitalization of the parameters is unimportant.
 +
 
 +
=== See also ===
 +
*{{tl|mi to km}}
 +
*{{tl|convert}}
 +
 
 +
<includeonly>
 +
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
 +
 
 +
</includeonly>

Latest revision as of 19:07, 29 February 2020


Usage

{{convert/km to mi | num | abbr | spell | precision | wiki}}
Examples
Manual of Style notation: {{convert/km to mi|100}} → 100 kilometers (62 mi)
Short notation: {{convert/km to mi|100|abbr=yes}} → 100 km (62 mi)
Full notation: {{convert/km to mi|num=100|abbr=no|spell=Commonwealth|precision=2|wiki=yes}} → 100 kilometres (62.14 miles)

Italicized parameters are optional:

  • num is a required parameter, which specifies the number of kilometers to be converted to miles. Please do not format this parameter; i.e., use 1234 instead of 1,234.
  • abbr can take values of either mos, yes, or no. Mos will show the names of the units as specified in the Manual of Style for dates and numbers (kilometers, mi); yes will show the abbreviated names of the units (km, mi); and no will show the full names of the units (kilometers, miles). The default value is mos.
  • spell can take values of American or Commonwealth and is only meaningful when abbr is set to no. American will use "kilometers", and Commonwealth—"kilometres". The default value is American.
  • precision is the number of decimal digits in the converted value. The default value is 0.
  • wiki specifies whether the names of the units should be wikified or not and can take values of either yes or no. The default value is no.

Capitalization of the parameters is unimportant.

See also