Template:Dist: Difference between revisions

From OniGalore
Jump to navigation Jump to search
(surprised we didn't make this years ago)
(No difference)

Revision as of 00:23, 15 February 2023

Call this template to convert between metric and imperial units of length. Both the original and converted length will be displayed, with the unit you supplied coming first.

Here are all the conversions supported by the template. If you want anything else to be supported, you can add it yourself; the existing code should be easy to follow.

{{Dist|100|cm|in}}
yields
100 cm (39.37 in)

{{Dist|100|in|cm}}
yields
100 in (254 cm)

{{Dist|100|km|mi}}
yields
100 km (62.14 mi)

{{Dist|100|mi|km}}
yields
100 mi (160.93 km)

{{Dist|100|ft|m}}
yields
100 ft (30.48 m)

{{Dist|100|m|ft}}
yields
100 m (328.08 ft)