The mixed converter Template:Convert/mix2 will 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 precision to 2 decimal places:

  • {{convert/mix2 |5|in|cm|by|3|ft|m}}        → 5 дюйм by 3 фут (13 см by 0.91 м)
  • {{convert/mix2 |5|in|cm|x|1.4|ft|m|p=2}}     → 5 дюйм × 1,4 фут (12.70 см × 0.43 м)
  • {{convert/mix2 |9|ft|m|high, weighing|56|kg}} → 9 фут high, weighing 56 килоgrams (2.7 м high, weighing 1,975 oz)
  • {{convert/mix2 |750|m|ft|up to|3|km|mi}}     → 750 метр up to 3 километр (2,460 ft up to 1.9 mi)
  • {{convert/mix2 |5+1/2|in|m|by|1+2/3|ft|m}}    → 5 12 дюйм by 1 23 фут (0.14 м by 0.51 м)

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