**T**he {{convert}} plugin is an implementation of the Wikipedia template of the same name, and can be used in much the same way to convert units in one measurement to another, as in miles to kilometres for instance.

## Examples and parameters

The plugin is invoked by inserting {{convert|some arguments}} into the text of an article. It accepts an amount in one unit of measurement and converts it to another, inserting the formatted result into the body of the article. {{convert}} takes two mandatory parameters, separated by the “|” character: the quantity to be converted and the code for the units of that quantity; all other parameters are optional.

Supported units and their codes are given in the table at the end of this section.

## Units to convert

- {{convert|15|km|mi}} → 15 kilometres (9 mi)
The output unit of measurement can usually be omitted, as each input unit of measurement has an associated measurement to be converted to. In the case of kilometres the default is miles, but that can be overridden and specified explicitly as above:

- {{convert|15|km}} → 15 kilometres (9 mi)

## Unit name or abbreviation

By default, the first quantity shows the full name of the unit, the second shows the symbol (or abbreviation):

- {{convert|1|lb}} → 1 pound (0.45 kg)
Using |abbr=on results in the input unit of measurement being abbreviated:

- {{convert|1|lb|abbr=on}} → 1 lb (0.45 kg)

## Adjective:

a 10-mile distanceUse |adj=on to produce the adjectival (hyphenated) form:

- A {{convert|10|mi|adj=on}} distance → A 10-mile (16 km) distance.
The output is hyphenated only if the input unit of measurement is not abbreviated:

- {{convert|10|mi|abbr=on|adj=on}} → 10 mi (16 km)

## Rounding

By default the number of decimal places in the output will be the same as that of the input:

- {{convert|10.5|km}} → 10.5 kilometres (6.5 mi)
This default behaviour can be overridden by using the |r parameter to specify the required number of decimal places:

- {{convert|10.5|km|r=0}} → 10.5 kilometres (7 mi)
- {{convert|10.5|km|r=2}} → 10.5 kilometres (6.52 mi)

## Spell out numbers:

ten milesTo display a number in words use |spell=in:

- {{convert|100|mi|spell=in}} → one hundred miles (161 km)
If the output from {{convert}} begins a sentence as in “Twenty-five miles (40 km) down the road …”, and |spell=in has been set, then the leading character can be capitalised with |sentence=on:

- {{convert|25|mi|spell=in|sentence=on}} → Twenty-five miles (40 km)

### Units

Conversion can only be carried out between units of the same type, e.g. length or area. It would be meaningless, for instance, to attempt to convert between degrees celsius and kilograms.

System | Unit | Code | Abbreviation | Default conversion |

Lengths | ||||

SI | millimetre | mm | mm | mm => in |

centimetre | cm | cm | cm => in | |

metre | m | m | m => ft | |

kilometre | km | km | km => mi | |

Imperial | inch | in | in | in => cm |

foot | ft | ft | ft => m | |

yard | yd | yd | yd => m | |

mile | mi | mi | mi => km | |

fathom | fathom | fathom | fathom => m | |

furlong | furlong | furlong | furlong => m | |

Area | ||||

SI | square metre | sqm | m^{2} | sqm => sqft |

square kilometre | sqkm | km^{2} | sqkm => sqmi | |

non-SI metric | hectare | ha | ha | ha => acre |

Imperial | square foot | sqft | ft^{2} | sqft => sqm |

square yard | sqyd | yd^{2} | sqyd => sqm | |

square mile | sqmi | mi^{2} | sqmi => sqkm | |

acre | acre | acre | acre => ha | |

Weight | ||||

SI | kilogram | kg | kg | kg=>lb |

Imperial | pound | lb | lb | lb=>kg |

Temperature | ||||

SI | celsius | C | °C | C => F |

Imperial | fahrenheit | F | °F | F => C |

Speed | ||||

SI | kilometres per hour | km/h | km/h | km/h = > mph |

Imperial | miles per hour | mph | mph | mph = > km/h |

Volume | ||||

SI | litre | l | L | l => impgal |

Imperial | gallon | impgal | Gal | impgal => l |