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 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
[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)"
Parameter | Description | Type | Status | |
---|---|---|---|---|
Distance (km) | 1 | Specify a distance in kilometres. | Number | required |
Optional parameter | 2 | Optional parameter set to "on"' or "adj" to produce the adjective form, e.g. "16-kilometre (10 mi)" | String | optional |