Jump to content

User:Wikid77/Template:Gconvert

From Wikipedia, the free encyclopedia
This template is being used to diagnose rounding tactics to improve the performance of Template:Convert. Do not delete this template without a legal AfD process, discussed to reach consensus.
The Template:Gconvert is a variation of Template:Convert, intended for general-purpose conversions, where the amount being converted is exactly specified, rather than being a possible estimate. To round the results to another level, append a parameter "-2" or "2" (etc.) when using Gconvert.

Usage

[edit]
{{Gconvert|<num>|<unit>|<newunit>}}
{{Gconvert|<num>|<unit>|<newunit>|2}} - show 2 decimals
{{Gconvert|<num>|<unit>|<newunit>|-2}} - round hundreds
{{Gconvert|<n>|<unit1>|<n2>|<unit2>|<newunit>}} - round hundreds

The parameters are identical to Template:Convert. The options include: abbr=off, sp=us, disp=/, disp=or, adj=on (explained below).

Parameters

[edit]

The following are the parameters handled by Template:Gconvert:

  • Parameter 1 is amount to convert, can contain commas.
  • abbr=off - turns off abbreviation, shows "meters" or "feet" (default: abbr=on).
  • sp=us - triggers U.S. spelling, shows "meters" else "metres" (default: sp=en).
  • disp=/   - displays slash between numbers (default: disp=b).
  • disp=or - displays "or" between numbers (default: parentheses).
  • adj=on - turns on adjective-mode, shows "-m" (default: adj=off).

Those parameters are the same as in template {{Convert}}.

Examples

[edit]
{{Gconvert|0.01|m}}   gives:  0.01 metres (User:Wikid77/Template:Convert/ftin)
{{Gconvert|1.03|m}}   gives:  1.03 metres (User:Wikid77/Template:Convert/ftin)
{{Gconvert|3.6|m}}     gives:  3.6 metres ()
{{Gconvert|5|kg}}         gives:  5 kilograms ()
{{Gconvert|8|km|abbr=off}}   gives:  8 kilometres ()
{{Gconvert|33|kg}}         gives:  33 kilograms ()
{{Gconvert|180|km}}       gives:  180 kilometres ()
{{Gconvert|1,247|m}}     gives:  1,247 metres ()
{{Gconvert| 16*90 |kg|lb}}     gives:  16*90 kilograms ()
{{Gconvert|29*1,000 +29|ft|m}}     gives:  29 * 1,000+29 feet ()

See also

[edit]