ವಿಷಯಕ್ಕೆ ಹೋಗು

ಟೆಂಪ್ಲೇಟು:Convert/show2/doc

ವಿಕಿಪೀಡಿಯದಿಂದ, ಇದು ಮುಕ್ತ ಹಾಗೂ ಸ್ವತಂತ್ರ ವಿಶ್ವಕೋಶ
The converter Template:Convert/show2 will convert an amount to any 2 output units and display the results with special formatting. To set the rounding precision, the output unit must be specified, or put "0" to default.
Usage:     {{convert/show2 |100.51432|m|ft|yd|r1=1}}
{{convert/show2 |1,234|km|mi|yd|comma=off}}
{{convert/show2 |10.5|L|usgal|impgal|3|x3=exactly}}
{{convert/show2 |7|km|mi|yd|disp=x|long (|)}} - custom output

There are special options with Convert/show2, such as "sep=or" to separate the 2 output amounts, "r1=2" to round the input amount to 2 decimals, "r2=1" or "r3=1" to round amounts 2 or 3, "comma=out" to show commas only in the output amount, near=25 (or 50) to round to nearest 25, and x0=xx to x8=xx to insert text before/after the amounts or unit names.

       12,340 kilometres (7,670 miles; 2,556.7 leagues)
       |     |          | |    |     | |      |       |
       x0   x1         x2 x3   x4   x5 x6     x7     x8

While parameters x0 and x1 insert text before or after the first amount, x2 follows the input unit, x3 puts text before the 1st output amount (such as "~"), x4 follows the 1st output amount, and x5 follows the 1st output unit, then x6 puts text before the 2nd output amount ("~"), x7 follows the 2nd output amount, and x8 follows the 2nd output unit.

The template allows 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=or, disp=comma, disp=x (customized), disp=sqbr (square brackets), disp=b (default as parentheses), disp=2 (or disp=out) and disp=# (or disp=number).

The examples show various options of conversions:

  • {{convert/show2 |1,234|km|mi|yd|comma=off}} → 1234 kilometres (767 mi; 1350000 yd)
  • {{convert/show2 |1,234|km|mi|yd|sep=or}}       → ೧,೨೩೪ kilometres (೭೬೭ mi or ೧,೩೫೦,೦೦೦ yd)
  • {{convert/show2 |950|km|mi|in|abbr=~}}    → ೯೫೦ kilometres (km, ೫೯೦ mi; ೩೭,೦೦೦,೦೦೦ in)
  • {{convert/show2 |3.1415926|km|mi|yd|r1=2}} → ೩.೧೪ kilometres (೧.೯೫೨೦೯೫೧ mi; ೩,೪೩೫.೬೮೭೪ yd)
  • {{convert/show2 |9,564|km|mi|yd|comma=out}}     → 9564 kilometres (೫,೯೪೩ mi; ೧೦,೪೫೯,೦೦೦ yd)
  • {{convert/show2 |9,564|km|mi|yd|lk=in|near=5}}    → ೯,೫೬೪ kilometres (೫,೯೪೫ mi; ೧,೦೪,೫೯,೦೦೦ yd)
  • {{convert/show2 |9,564|km|mi|yd|lk=out|near=50}} → ೯,೫೬೪ kilometres (೫,೯೫೦ mi; ೧,೦೪,೫೯,೦೦೦ yd)
  • {{convert/show2 |10.5|L|usgal|impgal|4|x3=exactly}} → ೧೦.೫ litres (exactly ೨.೭೭೩೮ US gal; ೨.೩೦೯೭ imp gal)

Display types: disp=comma, disp=semi, disp=or, disp=out, disp=number, disp=x and disp=b. The numeric results are identical to using Template:Convert to show numerals instead of words.

Common problems

[ಬದಲಾಯಿಸಿ]

Note the name of this template is "convert/show2" and omitting the suffix "/show2" will not show special formatting. Also, putting "show2" as parameter 1 will cause the number to be treated as a template name "Convert/<number>" such as {{convert|show2|34|km}} will show "[convert: invalid number]".

The amount is followed by a unit-code (such as "|m") as the 2nd parameter. The output unit-code can be "0" as the 3rd parameter, to allow the default output unit to be triggered, while setting parameter 5 to a rounding precision (such as "|3") or use r=3 to set the rounding level.