Difference between revisions 5551606 and 5553429 on simplewiki

{{Documentation subpage}}

The mixed converter '''[[Template:Convert/mix2]]''' will [[conversion of units|convert]] 2 amounts of different units at once, allowing any range words/text between the 2 amounts. However, both amounts can use different units, or the same unit type. The output unit must be specified, or put "0" for the default output unit.

: '''Usage''':    {{convert/mix2 |5|in|cm|by|3|ft|m}}
:::: {{convert/mix2 |9|ft|m|high, weighing|56|kg}}
:::: {{convert/mix2 |750|m|ft|up to|3|km|mi}}
:::: {{convert/mix2 |11|in|cm|m|x|1.6|ft|m|abbr=on}}
The template has the same parameters as [[Template:Convert]], and so it allows abbreviation abbr=in or abbr=out or abbr=none, wikilinks lk=on, lk=in or lk=out, and adjective mode adj=on. The separator can also be a semicolon: disp=semi, disp=or, disp=comma, disp=x & disp=b (default parentheses). Using optional parameter "warn=yes" will warn when the separator is an unusual word (other than: to, by, and, or, -, +/-, x, xx or comma).

; Examples
The following examples show various separator text, with p=2 to round the [[Significant figures#Identifying significant figures|precision]] to 2 decimal places:
* {{convert/mix2 |5|in|cm|by|3|ft|m}}{{in5|8}}→ {{convert/mix2 |5|in|cm|by|3|ft|m}}
* {{convert/mix2 |5|in|cm|x|1.4|ft|m|p=2}}{{in5}}→ {{convert/mix2 |5|in|cm|x|1.4|ft|m|p=2}}

* {{convert/mix2 |9|ft|m|high, weighing|56|kg}} → {{convert/mix2 |9|ft|m|high, weighing|56|kg}}
* {{convert/mix2 |750|m|ft|up to|3|km|mi}}{{in5}}→ {{convert/mix2 |750|m|ft|up to|3|km|mi}}

* {{convert/mix2 |5+1/2|in|m|by|1+2/3|ft|m}}{{in5|4}}→ {{convert/mix2 |5+1/2|in|m|by|1+2/3|ft|m}}

Any text can separate the amounts, but the typical range-words are: to, by, and, or, -, +/-, x, xx & comma.
Display types: disp=comma, disp=semi, disp=or, disp=s, disp=2 (or disp=out), disp=# (or disp=number), disp=x and disp=b. The results are identical to using Template:Convert for each amount individually, and then mixing the inputs and outputs.

; Common problems
Because there are 2 sets of unit-codes (for 2 inputs and 2 outputs), care must be taken to place all 7 parameters in the proper order. Note that the name of the template is "Convert/mix2" and omitting the "/mix2" will produce incorrect results. Some issues to note:
:* Check the placement of all 7 parameters for both sets of unit-codes.
:* Remember the name as "convert/mix2".
:* To skip an output unit, put "0" to get the default output.
:* When using disp=x, the custom text is in parameters 8 and 9.

; See also
* [[Template:Convert/2]] - to convert 2 amounts of the same unit
* [[Template:Convert/3]] - to convert 3 amounts of the same unit
* [[Template:Convert/4]] - to convert 4 amounts of the same unit
<includeonly>
[[Category:Subtemplates of Template Convert]]
</includeonly><noinclude>
[[Category:Subtemplates of Template Convert/documentation|Mix2]]
</noinclude>