Template:Convert/doc
Jump to navigation
Jump to search
This is a documentation subpage for Template:Convert. It may contain usage information, categories and other content that is not part of the original template page. |
- Not to be confused with Template:docsub.
Shortcut {{cvt}} |
The {{convert}} calculates the value of a measurement in one unit from the value of another unit and presents a formatted result. The result can be rounded.
Usage
- Basic usage:
{{convert|1|2}}
- Full usage:
{{convert|1|2|3}}
Parameters
Parameter | Description | Type | Status | Notes |
---|---|---|---|---|
1 |
Measurement value | Numeric | Required | May be formatted or unformatted |
2 |
Measurement unit | String | Required | Use the unit code from supported units below |
3 |
Rounding | Numeric | Optional | Defaults to the nearest integer. Setting a positive number adds decimal places. Setting a negative number rounds to the left of the decimal point (e.g., tens, hundreds, thousands, etc.). |
Supported units
Unit | Unit code | Calculated unit | Sample default result |
---|---|---|---|
kilometer | km | mile | 10 km (6 mi) |