Template:Convertx
Jump to navigation
Jump to search
This template is being used to diagnose subtemplate nesting to improve the performance of Template:Convert. Do not delete this template without a full AfD process, discussed to reach consensus. |
The Template:Convertx is an extension to the standard Wikipedia converter Template:Convert. The intention is to develop new features to be incorporated into the standard version, rather than create a divergent set of similar subtemplates. This is an official template.
To test impromptu edits to Template:Convert, instead, use the typical open sandbox area: Template:Convert/sandbox, which allows for general experimentation. In contrast, the various subtemplates under Template:Convertx are used in an official manner to support live articles as new features are approved. |
Usage
- {{Convertx|<num>|<unit>|<newunit>}}
- {{Convertx|<num>|<unit>|<newunit>|2}} - show 2 decimals
- {{Convertx|<num>|<unit>|<newunit>|-2}} - round hundreds
- {{Convertx|<n>|<unit1>|<n2>|<unit2>|<newunit>}} -for 2 units
The basic parameters are identical to Template:Convert. The options include: abbr=off, abbr=on, sp=us, disp=/, disp=or, disp=s, disp=output number only, adj=on (explained below).
Parameters
The following are the main parameters for Template:Convertx:
- Parameter 1 is the amount to convert, can contain commas or a formula.
- abbr=none - turns off abbreviation, shows "meters" or "feet" (default: abbr=off).
- sp=us - triggers U.S. spelling, shows "meters" else "metres" (default: sp=en).
- disp=/ - displays slash between numbers (default: disp=b).
- disp=s - displays slash between numbers (same as disp=/).
- disp=or - displays "or" between numbers (default: parentheses).
- disp=semi - displays semicolon ";" between numbers.
- disp=table - displays a hidden sort-tag for use in sortable tables.
- disp=output number only - displays only the resulting number.
- adj=on - turns on adjective-mode, shows "-m" (default: adj=off).
- Those parameters are similar to template {{Convert}}.
The following are added parameters for Template:Convertx:
- comma=out - put commas only in output, or comma=in, or comma=off
- round=in - also round the input amount
- v=xx - Variation option, invokes a Convert/DgenVxx.
- dgen - The name of the display subtemplate, as dgen=DgenVxx.
Examples
- {{Convertx|0.01|m}} gives: 0.01 metres ({{rnd/bExpression error: Unrecognized punctuation character "[".|Expression error: Unrecognized punctuation character "[".|(Template:Max/3)|Expression error: Unrecognized punctuation character "[". }} in)
- {{Convertx|1.03|m}} gives: 1.03 metres ({{rnd/bExpression error: Unrecognized punctuation character "[".|Expression error: Unrecognized punctuation character "[".|(Template:Max/3)|Expression error: Unrecognized punctuation character "[". }} in)
- {{Convertx|3.6|m}} gives: 3.6 metres (12 ft)
- {{Convertx|6.1957|m}} gives: 6.1957 metres (20.327 ft)
- {{Convertx|5|kg}} gives: Template:Convertx/kg
- {{Convertx|110|lb}} gives: 110 pounds (Template:Convertx/kg)
- {{Convertx|8|km|abbr=on}} gives: Template:Convertx/Dgen
- {{Convertx|33|kg}} gives: Template:Convertx/kg
- {{Convertx|83|kg}} gives: Template:Convertx/kg
- {{Convertx|180|km}} gives: Template:Convertx/Dgen
- Heights
- {{Convertx|32|m|ft}} gives: 32 metres (105 ft)
- {{Convertx|32.|m|ft|disp=or}} gives: Template:Convertx/LoffAoffDorSoff
- {{Convertx|32.|m|ft|disp=semi}} gives: Template:Convertx/LoffAoffDsemiSoff
- {{Convertx|200|m|ft}} gives: 200 metres (660 ft)
- {{Convertx|200.3|m|ft}} gives: 200.3 metres (657 ft)
- {{Convertx|6|ft|3|in|cm}} gives: Template:Convertx/Dgen2
- {{Convertx|6|ft|5|in|cm|disp=s}} gives: Template:Convertx/Dgen2
See also
- Template:Gconvert - variation for general-purpose conversions.