साँचा:Unit display/doc
Usage
This template is one of the unit display category of templates. These are templates which print figures with their units and converts them to either English or metric system too. The second value is in brackets. Both parameters should be unformated numbers, the first one is the actual value, the second one is the number of decimal digits for the calculated value. The numbers are then nicely formated.
If you append "| lk=on" to the template the units will be wikilinked, otherwise they will not be. The manual of style suggests that you only link the first instance.
The Manual of Style Units Section specifies that you should spell out the primary unit in text therefore you should use the full version (where available) e.g. {{Unit foot}}, in sentences and the abbreviated version e.g. {{Unit ft}} in tables, info boxes, etc.
If the grammar of a sentence requires that the singular version of a spelled out unit is required append "| sing=on" to the template.
Examples:
- {{Unit km | 1487.27 }} renders as: 1,487.27 कि॰मी॰ (924.146733079 मील)
- {{Unit mi | 1487.27 | 2}} renders as: 1,487.27 मील (2,393.53 कि॰मी॰)
- {{Unit sqkm | 1487.27 | 2 | lk=on }} renders as: 1,487.27 वर्ग कि.मी. (574.24 वर्ग मील)
- {{Unit foot | 1487.27 | 2 }} renders as: 1,487.27 feet (453.32 m)
- {{Unit foot | 1487.27 | 2 | sing=on }} renders as: 1,487.27 foot (453.32 m)
- {{Unit metre | 1487.27 | 2 | lk=on }} renders as: 1,487.27 मीटर (4,879.49 फीट)
- {{Unit metre | 1487.27 | 2 | lk=on | sing=on }} renders as: 1,487.27 मीटर (4,879.49 फीट)
It is important to note that negative values are OK for the rounding parameter, which is very useful for converting approximate values:
- {{Unit ft | 14000 | 0}} renders as: 14,000 फीट (4,267 मी॰)
- {{Unit ft | 14000 | -1}} renders as: 14,000 फीट (4,270 मी॰)
- {{Unit ft | 14000 | -2}} renders as: 14,000 फीट (4,300 मी॰)
See also
संपादित करें- Category:Unit display for similar templates.
- Template:Unit display/tests for tests of these templates.
- {{Convert}} template which takes in source and destination units