Template:Unit of length

From Wikipedia, the free encyclopedia

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

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 intricate features of template syntax.
Please do not alter it unless you are certain to understand its setup and parser functions and are ready to repair/revert all collateral damage if results are unexpected.
Any experiments should be conducted and all improvements tested in the template sandbox, or in your user space, before applying anything here.