Template:Infobox mobile phone/weight/doc: Difference between revisions

From Wikipedia, the free encyclopedia

Content deleted Content added


Revision as of 04:50, 16 September 2025

This template is used to automatically add conversions of weight measurements displayed by Template:Infobox mobile phone.

Usage

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

Examples

Grams:

  • |weight=1 gram → 1 g (0 oz)
  • |weight=108 g. → 108 g (4 oz)
  • |weight=111grams → 111 g (4 oz)
  • |weight=108 g. → 108 g (4 oz)

Pounds:

  • |weight=1 pound → 1 pound
  • |weight=200 lb. → 200 lb.
  • |weight=245pounds → 245pounds
  • |weight=238 lbs. → 238 lbs.

Stone:

  • |weight=1 stone → 1 stone
  • |weight=10 st. → 10 st.
  • |weight=17stones → 17stones
  • |weight=17 sts. → 17 sts.

Stone and pounds:

  • |weight=17 stone, 7 pounds → 17 stone, 7 pounds
  • |weight=17 st. 7 lb. → 17 st. 7 lb.
  • |weight=17stones 1pound → 17stones 1pound
  • |weight=17 sts. 1 lbs. → 17 sts. 1 lbs.

Text and/or footnotes (references) after weight:

  • |weight=108 kgs (2012) → 108 kg (2012)
  • |weight=238 lbs<ref>citation goes here</ref> → 238 lbs[1]
  • |weight=238 lbs (2012)<ref>{{cite news|title=title|work=work}}</ref> → 238 lbs (2012)[2]
Example references
  1. ^ citation goes here
  2. ^ “title”. work.

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

  • |weight={{Convert|111|kg|lb stlb|abbr=off}} → 111 kilog (245 pounds; 17 stone 7 pounds)
  • |weight={{Convert|111|kg|lb stlb|abbr=off|lk=on}} → 111 kilogs (245 pounds; 17 stone 7 pounds)
    • 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}} → 245 pounds (111 kilog; 17 stone 7 pounds)
  • |weight={{Convert|245|lb|kg stlb|abbr=off|lk=on}} → 245 pounds (111 kilogs; 17 stone 7 pounds)
    • 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 kg → 108–111 kg
  • |weight=238–245 lb → 238–245 lb
  • |weight=17–18 st → 17–18 st

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

  • |weight=108-111 kg → 108-111 kg
  • |weight=238-245 lb → 238-245 lb
  • |weight=17-18 st → 17-18 st

If a template uses {{Infobox mobile phone/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 kg → 100 kg
  • |weight=108–111 kg → 108–111 kg

If a template uses {{Infobox mobile phone/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 lb → 200 lb
  • |weight=238-245 lb → 238-245 lb

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) → 108 kilog (229 pounds)
  • |weight=238 pounds (119 kilograms) → 238 pounds (119 kilog)
  • |weight=17 stone (229 pounds; 119 kilograms) → 17 stone (229 pounds; 119 kilog)

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}} → 108.1 kilog (238.3 pounds)
    • output of convert template: 108.1 kilograms (238.3 pounds)
  • |weight={{convert|238.2|lb|kg|2|abbr=off}} → 238.2 pounds (108.05 kilog)
    • output of convert template: 238.2 pounds (108.05 kilograms)
  • |weight={{convert|17.3|st|1|abbr=off}} → 17.3 stone (242.2 pounds; 109.9 kilog)
    • 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 Kilograms → 100 Kilog
  • |weight=100 KG → 100 KG
  • |weight=200 Pounds → 200 Pounds
  • |weight=200 LB → 200 LB
  • |weight=10 Stone → 10 Stone
  • |weight=10 ST → 10 ST

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top