Jump to content

User:Wikid77/Template:Lenbot

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:Lenbot simply compares the given length to some common-sense levels of length, and then auto-formats the length in feet, with inches, decimal feet xxx.x, or rounded whole feet, based on number sense about common measurements. Usage:
{{Lenbot|xxx.x}}
{{Lenbot|m=xxx.x}}
{{Lenbot|1.2}} - for 1.2 meters.
{{Lenbot|5300}} - for 5300 meters.
{{Lenbot|5|abbr=off}} - show "feet".
Options include: abbr=off, sp=us, disp=/, disp=or, adj=on (explained below).

The length levels for choosing format are based on meters (m):

m < 6: shows feet & inches
m < 50: shows feet to 1 decimal, xxx.x
m > 50: shows feet rounded to whole feet.

The parameter "m" defaults to the first unnamed parameter. For example:

{{Lenbot|abbr=no|34}} - uses "34"

Parameters:

  • Parameter 1 is meters (or m=), 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]
{{Lenbot|0.01}}   gives:  0.01 m (12 in)
{{Lenbot|1.03}}   gives:  1.03 m (3 ft 4+12 in)
{{Lenbot|3.6}}     gives:  3.6 m (11 ft 9+12 in)
{{Lenbot|5}}         gives:  5 m (16 ft 5 in)
{{Lenbot|8|abbr=off}}   gives:  8 metres (26.2 feet)
{{Lenbot|33}}         gives:  33 m (108.2 ft)
{{Lenbot|187}}       gives:  187 m (613 ft)
{{Lenbot|1,247}}     gives:  1,247 m (4,090 ft)
{{Lenbot|31.5}}     gives:  31.5 m (103.3 ft)
{{Lenbot|32.5}}     gives:  32.5 m (106.6 ft)

NOTE: When translating articles from German Wikipedia, use template Lenbot
to handle the German templates for length.