Wiktenauer logo.png

Template:Convert/4

From Wiktenauer
< Template:Convert
Revision as of 02:21, 23 September 2012 by Michael Chidester (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

10×20×30×40 Template:Convert/LoffAdefDunitSoff (Template:Convert/LoffAdefDoutput number onlySoff×Template:Convert/LoffAdefDoutput number onlySoff×Template:Convert/LoffAdefDoutput number onlySoff×130 ft)

The converter Template:Convert/4 will convert 4 amounts at once, allowing a mix of different range words between the 4 amounts. However, all 4 amounts are treated as the same unit type. The output unit must be specified, or put "0" to default.
Usage:  {{convert/4 |1|by|2|by|3|by|4|m|ft}}
{{convert/4 |1|x|2|x|3|x|4|m|ft}}
{{convert/4 |1|-|2|-|3|-|4|m|ft}}
{{convert/4 |7|to|8|by|3|to|4.5|km|mi|abbr=on}}

The template has the same parameters as Template:Convert, and so it allows abbreviation abbr=in or abbr=out or abbr=off, wikilinks lk=in or lk=out, and adjective mode adj=on or adj=mid. The separator can also be a semicolon: disp=semi, disp=semicolon, disp=or, disp=comma, disp=x (customized), disp=b (default as parentheses) and "disp=output only".

Examples

The examples show a mixture of "by" & "x" or "to" or "rarely" (etc.) in some conversions:

The range-words are: to, -, and, or, by, +/-, x, but slash ("/"), comma, or anything is allowed. Display types: disp=comma, disp=semi, disp=or, disp=output only, disp=output number only, disp=x and disp=b. The numeric results are identical to using Template:Convert for each amount individually.

Common problems

Note the name of this template is "convert/4" and omitting the suffix "/4" can cause the error message: "Template loop detected: Template:Convert/x". Be sure to put a range-word (such as "x") between each of the 4 amounts, to avoid error "Convert/4 - Invalid parameter 2".

The 4 amounts, with 3 range-words, are followed by a unit-code (such as "m") as the 8th parameter. The output unit-code can be "0" as the 9th parameter, to allow the default output unit to be triggered.