قالب:Convert/doc
From Wikipedia, the free encyclopedia
Template {{convert}} calculates a measurement value (number × unit) into the same measurement by a different unit, and then presents the results, formatted. The complete list of unit symbols recognized by the template is here.
This is a documentation subpage for قالب:Convert. It may contain usage information, categories and other content that is not part of the original قالب page. |
For currency conversion into US dollars, see Template:To USD.
See this information on copying this template and modifying it for use on another wiki. |
This template uses Lua: |
For example:
{{convert|2|km|mi}}
→ 2 kilometres (1.2 mi) (km entered, converted into miles){{convert|7|mi|km}}
→ 7 miles (11 km) (mi entered, converted into km)
Numbers can be rounded, units can be abbreviated into symbols:
{{convert|2|km|mi|2|abbr=on}}
→ 2 km (1.24 mi){{convert|7|mi|km|2|abbr=on}}
→ 7 mi (11.27 km)
Value ranges can be entered using |to|...
or |-|...
:
{{convert|2|to|5|km|mi}}
→ 2 to 5 kilometres (1.2 to 3.1 mi){{convert|2|-|5|km|mi}}
→ 2–5 kilometres (1.2–3.1 mi)
Combined effect example:
{{convert|2|-|5|km|mi|2|abbr=on}}
→ 2–5 km (1.24–3.11 mi){{convert|2|and|5|km|mi|sigfig=3|abbr=off}}
→ 2 and 5 kilometres (1.24 and 3.11 miles)
See Help:Convert for more detailed, technical information