Template:Convert/E

From WikiSwire
Jump to: navigation, search

{{rnd/bExpression error: Unexpected < operator.|Expression error: Unexpected < operator.|Expression error: Unrecognized punctuation character "[".|Expression error: Unexpected < operator. }} Template:Convert/LoffAnoneDunitSoff ({{rnd/bExpression error: Unexpected < operator.|Expression error: Unexpected < operator.|(Expression error: Unexpected < operator.)|Expression error: Unexpected < operator. }} feet)

The converter Template:Convert/E will convert an amount and display large numbers in x10 format ("3.4×1017") rather than E-format scientific notation: 3.4E+17. A resulting large 2nd amount will also be shown in x10 notation, when greater than 10 billion. To set the rounding precision, the output unit must be stated, or put "0" to default.
Usage:  {{convert/E |3.4E17|m|ft}}
{{convert/E |1,234|km|mi|abbr=on}}
{{convert/E |7,000,000,000|L|usgal|3}}
{{convert/E |65E9|km|mi|disp=x|long (|)}} - custom output

The template has the same parameters as Template:Convert, and so it allows abbreviation abbr=in or abbr=out or abbr=none, 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=br (brackets), disp=b (default as parentheses), disp=2 (or disp=out) and disp=# (or disp=number).

Examples

The examples show various options of conversions:

  • {{convert/E |3.4E17|km|mi}} → {{rnd/bExpression error: Unexpected < operator.|Expression error: Unexpected < operator.|Expression error: Unrecognized punctuation character "[".|Expression error: Unexpected < operator. }} Template:Convert/LoffAnoneDunitSoff ({{rnd/bExpression error: Unexpected < operator.|Expression error: Unexpected < operator.|(Expression error: Unexpected < operator.)|Expression error: Unexpected < operator. }} miles)
  • {{convert/E |123|km|mi|abbr=on}} → 123 km (76 mi)
  • {{convert/E |95.1|km|mi|lk=out}} → 95.1 Template:Convert/LoutAnoneDunitSoff (59.1 miles)
  • {{convert/E |1.88E19|ft|m|0}} → {{rnd/bExpression error: Unexpected < operator.|Expression error: Unexpected < operator.|Expression error: Unrecognized punctuation character "[".|Expression error: Unexpected < operator. }} Template:Convert/LoffAnoneDunitSoff (5.7302400000000×1018 metres)
  • {{convert/E |140|ft|m}} → 140 Template:Convert/LoffAnoneDunitSoff (43 metres)

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 scientific notation, rather than x10 notation.

Common problems

Note the name of this template is "convert/E" and omitting the suffix "/E" will not show x10 notation for very large numbers (instead, they will show as E-notation: 5E+13). Also, putting "E" as parameter 1 will cause the number to be treated as a template name "Convert/<number>" such as {{convert|E|7E13|km}} will show "Template:Convert/7E13".

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 4 to a rounding precision (such as "|5") or use r=5 to set the rounding level.