Template:Infobox person/weight/doc

From HandWiki

This template is used to automatically add conversions of weight measurements displayed by Template:Infobox person and other infoboxes with a |weight= parameter.

Template:Template see also

Usage

{{Infobox
...
| label# = Weight
| data#  = {{#if: {{{weight|}}} | {{Infobox person/weight|{{{weight}}}}} }}
...
}}

Examples

Kilograms:

  • |weight=1 kilogramScript error: No such module "Person weight".
  • |weight=108 kg.Script error: No such module "Person weight".
  • |weight=111kilogramsScript error: No such module "Person weight".
  • |weight=108 kgs.Script error: No such module "Person weight".

Pounds:

  • |weight=1 poundScript error: No such module "Person weight".
  • |weight=200 lb.Script error: No such module "Person weight".
  • |weight=245poundsScript error: No such module "Person weight".
  • |weight=238 lbs.Script error: No such module "Person weight".

Stone:

  • |weight=1 stoneScript error: No such module "Person weight".
  • |weight=10 st.Script error: No such module "Person weight".
  • |weight=17stonesScript error: No such module "Person weight".
  • |weight=17 sts.Script error: No such module "Person weight".

Stone and pounds:

  • |weight=17 stone, 7 poundsScript error: No such module "Person weight".
  • |weight=17 st. 7 lb.Script error: No such module "Person weight".
  • |weight=17stones 1poundScript error: No such module "Person weight".
  • |weight=17 sts. 1 lbs.Script error: No such module "Person weight".

Text and/or footnotes (references) after weight:

  • |weight=108 kgs (2012)Script error: No such module "Person weight".
  • |weight=238 lbs<ref>citation goes here</ref>Script error: No such module "Person weight".
  • |weight=238 lbs (2012)<ref>{{cite news|title=title|work=work}}</ref>Script error: No such module "Person weight".
Example references


{{Convert}} templates, without and with wikilinked unit names:

  • |weight={{Convert|111|kg|lb stlb|abbr=off}}Script error: No such module "Person weight".
  • |weight={{Convert|111|kg|lb stlb|abbr=off|lk=on}}Script error: No such module "Person weight".
    • output of convert template: 111 [[kilogram]]s (245 [[Pound (mass)|pounds]]; 17&nbsp;[[Stone (unit)|stone]] 7&nbsp;pounds)
  • |weight={{Convert|245|lb|kg stlb|abbr=off}}Script error: No such module "Person weight".
  • |weight={{Convert|245|lb|kg stlb|abbr=off|lk=on}}Script error: No such module "Person weight".
    • output of convert template: 245 [[Pound (mass)|pounds]] (111 [[kilogram]]s; 17&nbsp;[[Stone (unit)|stone]] 7&nbsp;pounds)

Weight ranges with input containing en dash (–):

  • |weight=108–111 kgScript error: No such module "Person weight".
  • |weight=238–245 lbScript error: No such module "Person weight".
  • |weight=17–18 stScript error: No such module "Person weight".

Weight ranges with input containing hyphen (-); output is changed to en dash by {{Convert}}:

  • |weight=108-111 kgScript error: No such module "Person weight".
  • |weight=238-245 lbScript error: No such module "Person weight".
  • |weight=17-18 stScript error: No such module "Person weight".

If a template uses {{Infobox person/weight|{{{weight}}}|kg-stlb=yes}}, then an article using that template with an input in kg will display two conversions: lb followed by st/lb (default is one conversion to lb):

  • |weight=100 kgScript error: No such module "Person weight".
  • |weight=108–111 kgScript error: No such module "Person weight".

If a template uses {{Infobox person/weight|{{{weight}}}|lb-stlb=yes}}, then an article using that template with an input in lb will display two conversions: kg followed by st/lb (default is one conversion to kg):

  • |weight=200 lbScript error: No such module "Person weight".
  • |weight=238-245 lbScript error: No such module "Person weight".

Exceptions

Does not replace numbers in manually entered conversions, but does replace unit names with abbreviations (examples intentionally show incorrect conversions):

  • |weight=108 kilograms (229 pounds)Script error: No such module "Person weight".
  • |weight=238 pounds (119 kilograms)Script error: No such module "Person weight".
  • |weight=17 stone (229 pounds; 119 kilograms)Script error: No such module "Person weight".

Does not replace numeric output of conversion templates such as {{convert}}, but does replace unit names with abbreviations (examples intentionally show different precision than usual):

  • |weight={{convert|108.1|kg|lb|1|abbr=off}}Script error: No such module "Person weight".
    • output of convert template: 108.1 kilograms (238.3 pounds)
  • |weight={{convert|238.2|lb|kg|2|abbr=off}}Script error: No such module "Person weight".
    • output of convert template: 238.2 pounds (108.05 kilograms)
  • |weight={{convert|17.3|st|1|abbr=off}}Script error: No such module "Person weight".
    • output of convert template: 17.3 stone (242.2 pounds; 109.9 kilograms)

Areas for improvement

Conversion not displayed if unit name contains uppercase characters:

  • |weight=100 KilogramsScript error: No such module "Person weight".
  • |weight=100 KGScript error: No such module "Person weight".
  • |weight=200 PoundsScript error: No such module "Person weight".
  • |weight=200 LBScript error: No such module "Person weight".
  • |weight=10 StoneScript error: No such module "Person weight".
  • |weight=10 STScript error: No such module "Person weight".