Template:Kilometer

(Redirected from Template:Km)

80 km (50 mi)

[view] [edit] [history] [purge] Template-info.svg Template documentation


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

"the trail is 8 km (5.0 mi) long" and "it's a 5-kilometre (3.1 mi) trail"

Usage

  • {{kilometer|2}} or {{km|2}} - will show as - 2 km (1.2 mi)
  • {{kilometer|10-15}} or {{km|10-15} - will show as - 10–15 km (6.2–9.3 mi)
  • {{kilometer|2|on}} or {{km|2|on} or {{km|2|adj} - will show as - 2-kilometre (1.2 mi)

Parameters

  • First parameter is distance number in kilometer
    • 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.