Jump to content

Template:Kilometer/doc

From Wikivoyage

To show distances in kilometres (and miles) such as:

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

Usage

[edit]
  • {{kilometer|2}} or {{km|2}}will show as2 km (1.2 mi)
  • {{kilometer|10-15}} or {{km|10-15}will show as10–15 km (6.2–9.3 mi)
  • {{kilometer|2|on}} or {{km|2|on} or {{km|2|adj}will show as2-kilometre (1.2 mi)

Parameters

[edit]
  • 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

[edit]
  • 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.

This template displays equivalent distances in kilometres and miles, e.g. "16 km (10 mi)"

Template parameters

ParameterDescriptionTypeStatus
Distance (km)1

Specify a distance in kilometres.

Numberrequired
Optional parameter2

Optional parameter set to "on"' or "adj" to produce the adjective form, e.g. "16-kilometre (10 mi)"

Stringoptional