Template:Unit of length

From Wikipedia, the free encyclopedia

1 {{{name}}} =
International units
m 1×10−3 km
1000 mm 10×109 Å
6.685×10−12 AU 105.7×10−18 LY
US customary / Imperial units
39.37 in 3.281 ft
1.094 yd 621.371×10−6 mi


The template will convert a length in metres to any of the lengths to the right. It uses the {{#expr:}} parser to convert.

[edit] Usage

{{Unit of length
|name= 
|m= 
|accuracy=
|nocat=
}}

name=unit name
m=distance of unit in metres
accuracy=number of decimal places (optional, default = 3)
nocat=to not add the page to Category:Units of length type " nocat= "

The resulting conversion will occur from the metre representation only. Any number larger than 10000 or smaller than 0.1 will be represented in Engineering notation, i.e. ×10 raised to a multiple of 3.

This template employs some extremely complicated and/or esoteric features of template syntax.
Please do not attempt to alter it unless you are certain that you understand the setup and are prepared to repair/revert any consequent collateral damage if the results are unexpected. Any experiments should be conducted in the template sandbox or your user space.