Difference between revisions of "Template:Convert/mile/doc"

From Teampedia
Jump to: navigation, search
 
(4 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
To show distances in mile (and kilometre) such as:
 
To show distances in mile (and kilometre) such as:
 
   
 
   
"the trail is {{mile|5}} long" and "it's a {{mi|5|on}} trail"
+
"the trail is {{mile|5}} long" and "it's a {{mile|5|on}} trail"
  
 
=== Usage ===
 
=== Usage ===
 
*'''<nowiki>{{mile|2}}</nowiki>''' or '''<nowiki>{{mi|2}}</nowiki>''' - ''will show as'' -  {{mile|2}}
 
*'''<nowiki>{{mile|2}}</nowiki>''' or '''<nowiki>{{mi|2}}</nowiki>''' - ''will show as'' -  {{mile|2}}
 
*'''<nowiki>{{mile|10-15}}</nowiki>''' or '''<nowiki>{{mi|10-15}</nowiki>''' - ''will show as'' -  {{mile|10-15}}
 
*'''<nowiki>{{mile|10-15}}</nowiki>''' or '''<nowiki>{{mi|10-15}</nowiki>''' - ''will show as'' -  {{mile|10-15}}
*'''<nowiki>{{mile|2|on}}</nowiki>''' or '''<nowiki>{{mi|2|on}</nowiki>''' or '''<nowiki>{{mi|2|adj}</nowiki>''' - ''will show as'' -  {{mile|2|adj}}
+
*'''<nowiki>{{mile|2|on}}</nowiki>''' or '''<nowiki>{{mi|2|on}</nowiki>''' or '''<nowiki>{{mi
 +
|2|adj}}</nowiki>''' - ''will show as'' -  {{mile|2|adj}}
  
 
=== Parameters ===
 
=== Parameters ===

Latest revision as of 18:41, 29 February 2020


To show distances in mile (and kilometre) such as:

"the trail is

  1. REDIRECT Template:Mo long" and "it's a
  2. Redirect Template:Convert/mi trail"

Usage

  • {{mile|2}} or {{mi|2}} - will show as - 2 miles (3 km)
  • {{mile|10-15}} or {{mi|10-15} - will show as - 10-15 miles (-14 km)
  • {{mile|2|on}} or {{mi|2|on} or {{mi |2|adj}} - will show as - 2 miles (3 km)

Parameters

  • First parameter is distance number in miles
    • also possible to show range using a dash
  • Second optional parameter set to on or adj to produce the adjective form

See also

  • Wikivoyage:Units
  • {{convert}} - from which this template is built; but this one removes the need to know full syntax and ensure consistent formatting throughout the site.