User:Wikid77/Template:Convert/per/doc
Appearance
This is a documentation subpage for User:Wikid77/Template:Convert/per. It may contain usage information, categories and other content that is not part of the original user template page. |
The Template:Convert/per is a variation of Template:Convert to handle per-unit conversions, such as counted items per metre.
Usage
[edit]The 1st parameter is the amount, but 2nd is the count-unit, followed by 3rd parameter as the base per-unit.
- {{convert/per |45|people|sqmi|km2}} → 45 people per square mile (17 people/km2)
The output count-unit defaults to the same (parameter 2), else use "out=" to reword the count-unit, such as singular/plural or abbreviated. Examples:
- {{convert/per |1|dog|sqmi|km2|out=dogs}} → 1 dog per square mile (0.39 dogs/km2)
- {{convert/per |1|person|sqmi|km2|out=ppl}} → 1 person per square mile (0.39 ppl/km2)
In most cases, the count-unit will use the same word for both input and output, as defaulted.
- {convert/per |3|[[warlocks]]|sqft|m2}} → 3 warlocks per square foot (32 warlocks/m2)
- {convert/per |3|[[warlocks]]|sqft|m2|lk=in}} → 3 warlocks per square foot (32 warlocks/m2)
Examples
[edit]Many options are allowed:
See also
[edit]- {{convert/f}} – convert an amount with special formatting
- {{convert/2}} – convert a set of 2 amounts, with any words between
- {{convert/3}} – convert a set of 3 amounts, with any words between
- {{convert/4}} – convert a set of 4 amounts, with any words between
- {{convert/flip2}} – convert 2 amounts flipped, with any words between
- {{convert/flip3}} – convert 3 amounts flipped, with any words between
- {{convert/flip4}} – convert 4 amounts flipped, with any words between
- {{convert/show2}} – convert 2 amounts, with free-form text
- {{convert/show3}} – convert 3 amounts, with free-form text