• Home
  • Random
  • Log in
  • Settings
  • About Safer nicotine wiki
  • Disclaimers
Safer nicotine wiki

Template:Convinfobox

  • Language
  • Watch
  • View source
Template documentation[view] [edit] [history] [purge]
WarningThis template is used on approximately 220,000 pages.
To avoid major disruption and server load, any changes should be tested in the template's /sandbox or /testcases subpages, or in your own user subpage. The tested changes can be added to this page in a single edit. Consider discussing changes on the talk page before implementing them.

This template is a frontend for {{convert}}. It is intended as a meta-template for use within the code for a template, where the input is not known a priori. For unit conversions within articles, one should use {{convert}} directly.

This template accepts from four to seven unnamed parameters. Odd parameters must be numerical (or empty) and specify the numerical value of a measurement and the intended precision of the conversion. Even parameters must be unit codes as used in {{convert}}. Named parameters are the same as used by {{convert}}.

This template differs from {{convert}} in the following respects.

  • The units to convert to and the units to convert from must be specified (therefore there are no default convert-to units).
  • Fields for the numerical value of a measurement may be left blank.
  • The default is to abbreviate units (where abbreviations exist).
  • Range conversions are not available.

This template may be used when it is unknown in which direction the conversion is to be made. The direction is determined as shown in the following examples.

  • {{convinfobox|100|m2||sqft}} → 100 m2 (1,100 sq ft)
  • {{convinfobox||m2|100|sqft}} → 100 sq ft (9.3 m2)

Contents

  • 1 Dual conversions
  • 2 Paired units
  • 3 Specifying more than one value
  • 4 Rounding
  • 5 Leaving all numerical fields blank
  • 6 See also

Dual conversions

Dual conversions may be performed by adding a fifth (possibly blank) and sixth unnamed parameter.

  • {{convinfobox|375|ml||impoz||USoz}} → 375 ml (13.2 imp fl oz; 12.7 US fl oz)
  • {{convinfobox||ml|40|impoz||USoz}} → 40 imp fl oz (1,100 ml; 38 US fl oz)
  • {{convinfobox||ml||impoz|32|USoz}} → 32 US fl oz (950 ml; 33 imp fl oz)

Paired units

Length may be expressed in feet and inches.

  • {{convinfobox|180|cm||ft||in}} → 180 cm (5 ft 11 in)
  • {{convinfobox||cm|5|ft||in}} → 5 ft (150 cm)
  • {{convinfobox||cm||ft|120|in}} → 120 in (300 cm)
  • {{convinfobox||cm|5|ft|6|in}} → 5 ft 6 in (168 cm)
  • {{convinfobox||ft||in|180|cm}} → 180 cm (5 ft 11 in)
  • {{convinfobox|5|ft||in||cm}} → 5 ft 0 in (152 cm)
  • {{convinfobox||ft|120|in||cm}} → 120 in (300 cm)
  • {{convinfobox|5|ft|6|in||cm}} → 5 ft 6 in (168 cm)

Similarly, mass may be expressed in pounds and ounces.

  • {{convinfobox|8.5|kg||lb||oz}} → 8.5 kg (18 lb 12 oz)
  • {{convinfobox||kg|4|lb|3|oz}} → 4 lb 3 oz (1.9 kg)

Mass may also be expressed in stone and pounds.

  • {{convinfobox|65|kg||st||lb}} → 65 kg (143 lb; 10 st 3 lb)
  • {{convinfobox||kg|10|st||lb}} → 10 st 0 lb (64 kg; 140 lb)
  • {{convinfobox||kg|10|st|7|lb}} → 10 st 7 lb (67 kg; 147 lb)
  • {{convinfobox||kg||st|145|lb}} → 145 lb (66 kg; 10 st 5 lb)

Specifying more than one value

The template currently bases conversions on the first non-blank numerical value ignoring any secondary or tertiary values.

  • {{convinfobox|100|m2|100|sqft}} → 100 m2 (1,100 sq ft)
  • {{convinfobox|375|ml|40|impoz||USoz}} → 375 ml (13.2 imp fl oz; 12.7 US fl oz)
  • {{convinfobox|375|ml||impoz|32|USoz}} → 375 ml (13.2 imp fl oz; 12.7 US fl oz)
  • {{convinfobox||ml|40|impoz|32|USoz}} → 40 imp fl oz (1,100 ml; 38 US fl oz)

Rounding

As with {{convert}} rounding can be done automatically or manually by specifying the precision and/or number of significant figures in the converted value. The number of significant figures can be determined by the parameter |sigfig=. The precision can be determined by the fifth (if there is no sixth) or seventh (if there is a sixth) unnamed parameter as shown in the examples below.

  • {{convinfobox|100|m2||sqft|4}} → 100 m2 (1,076.3910 sq ft)
  • {{convinfobox|100|m2||sqft|sigfig=4}} → 100 m2 (1,076 sq ft)
  • {{convinfobox||ml|40|impoz||USoz|2}} → 40 imp fl oz (1,136.52 ml; 38.43 US fl oz)
  • {{convinfobox||ml|40|impoz||USoz|sigfig=3}} → 40 imp fl oz (1,140 ml; 38.4 US fl oz)
  • {{convinfobox||kg|10|st|7|lb|3}} → 10 st 7 lb (66.678 kg; 147.000 lb)
  • {{convinfobox||kg|10|st|7|lb|sigfig=5}} → 10 st 7 lb (66.678 kg; 147.00 lb)

Specify precision "0" to prevent rounding of values ending in zero:

  • kilograms (kg)
    • with "0": {{convinfobox|110|kg||lb|0}} → 110 kg (243 lb)
    • without: {{convinfobox|110|kg||lb}} → 110 kg (240 lb)
  • pounds (lb)
    • with "0": {{convinfobox||kg|240|lb|0}} → 240 lb (109 kg)
    • without: {{convinfobox||kg|240|lb}} → 240 lb (110 kg)
  • metres (m)
    • with "0": {{convinfobox|100|m||ft|0}} → 100 m (328 ft)
    • without: {{convinfobox|100|m||ft}} → 100 m (330 ft)
  • inches (in)
    • with "0": {{convinfobox||cm|100|in|0}} → 100 in (254 cm)
    • without: {{convinfobox||cm|100|in}} → 100 in (250 cm)

Leaving all numerical fields blank

If all numerical value fields are left blank the template returns nothing.

  • {{convinfobox||m2||sqft}} →
  • {{convinfobox||ml||impoz||USoz}} →

See also

Supporting templates
  • Template:Convert (invokes Module:Convert)
  • Category:Subtemplates of Template Convinfobox
    • Template:Convinfobox/2
    • Template:Convinfobox/3
    • Template:Convinfobox/pri2
    • Template:Convinfobox/pri3
    • Template:Convinfobox/prisec3
    • Template:Convinfobox/priter3
    • Template:Convinfobox/sec2
    • Template:Convinfobox/sec3
    • Template:Convinfobox/secter3
    • Template:Convinfobox/ter3
Templates transcluding {{convinfobox}}
List
    1. Template:Infobox amusement park
    2. Template:Infobox animal
    3. Template:Infobox bandy biography
    4. Template:Infobox body of water
    5. Template:Infobox cemetery
    6. Template:Infobox college football player
    7. Template:Infobox combat robot
    8. Template:Infobox diocese
    9. Template:Infobox figure skater
    10. Template:Infobox football biography
    11. Template:Infobox hiking trail
    12. Template:Infobox islands/area
      • Template:Infobox islands (via Template:Infobox islands/area)
    13. Template:Infobox mountain
      • Template:Infobox Berg (via Template:Infobox mountain)
    14. Template:Infobox mountain range
      • Template:Infobox Gebirgsgruppe (via Template:Infobox mountain range)
    15. Template:Infobox NFL player
    16. Template:Infobox person
    17. Template:Infobox pipeline
    18. Template:Infobox power transmission line
    19. Template:Infobox protected area
    20. Template:Infobox rail line
      • Template:Infobox Paris Metro line (via Template:Infobox rail line)
    21. Template:Infobox rugby biography
    22. Template:Infobox rugby league biography
    23. Template:Infobox sportsperson
      • Template:Infobox biathlete (via Template:Infobox sportsperson)
      • Template:Infobox boxer (amateur) (via Template:Infobox sportsperson)
      • Template:Infobox sailor (via Template:Infobox sportsperson)
      • Template:Infobox speed skater (via Template:Infobox sportsperson)
      • Template:Infobox sport wrestler (via Template:Infobox sportsperson)
      • Template:Infobox swimmer (via Template:Infobox sportsperson)
    24. Template:Infobox tennis biography
    25. Template:Infobox themed area
    26. Template:Infobox valley
    27. Template:Infobox water park
    28. Template:Infobox YouTube personality


  • v
  • t
  • e
Math templates
  • Functions
  • Numeral systems
Functions
  • elementary arithmetic
  • precision
  • val (value formatting)
  • percentage
Numeral systems
  • {{#invoke:BaseConvert|XtoY}}
  • binary
  • decimal2Base
  • hex2dec
  • hexadecimal
  • octal
  • quaternary
  • quinary
  • rn
  • roman
  • senary
  • ternary
  • vigesimal
Conversions
convert many units (see: list)
cvt abbreviated {{convert}}
convinfobox {{convert}} for infoboxes
bbl to t barrels of oil to tonnes
long ton long hundredweights, quarters and pounds to kilograms;
long tons and hundredweights to pounds and metric tons
miles-chains miles and chains to kilometres linking "chains"
decdeg degrees, minutes, and seconds to decimal degrees
deg2dms decimal degrees to degrees, minutes, and seconds
deg2hms decimal degrees to hour angle (in hours, minutes, and seconds)
hms2deg hour angle (in hours, minutes, and seconds) to decimal degrees
inflation calculate inflation of Consumer Price Index-related prices
pop density population density in an area
track gauge railway track gauges
Notation and formatting
bigmath bigger font to match TeX \displaystyle (standalone formulas only)
  • bra-ket
  • braket
  • bra
  • ket
bra–ket notation
ceil, floor calculations :mw:Help:#expr; formatting indicators ⌈3.14⌉, ⌊3.14⌋ (no calculation performed)
fraction slant fractions 3⁄5 (not for maths/science articles; use standing or upright fractions {{sfrac}} instead)
intmath integral symbols
  • langle
  • rangle
  • angbr
angular brackets
  • ldelim
  • rdelim
multiline delimiters (2–5 lines inclusive)
abs absolute values (paired vertical lines)
math short text-based formulas
mathcal [mathematical] calligraphic font; alternative to LaTeX \mathcal{...}
mvar individual italicized maths variables in normal text
  • overline
  • underline
a line set above/below a sequence of characters
overarc an arc set above a sequence of characters
  • overset
  • underset
arbitrary characters/diacritics set above/below one another
pars parentheses that can be resized (∑)
sfrac "standing" or upright fractions 3/5 (use in maths/science articles instead of{{fraction}})
  • sub
  • sup
  • su
subscripts and superscripts
tmath Wrap TeX in <math> tags
tombstone symbol indicating the end of a proof
val measurement values, uncertainties and units
vec various overarrows, underarrows, etc.
  • Boxes
  • Tags
  • Notices
BoxesTags
  • arithmetic operations
  • calculus
  • Infobox mathematical function
  • functions
  • metricate
  • undue precision
  • units attention
Category · Module:Math
The above documentation is transcluded from Template:Convinfobox/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://safernicotine.wiki/mediawiki/index.php?title=Template:Convinfobox&oldid=22275"
Last edited on 2 January 2022, at 16:23
Cookies help us deliver our services. By using our services, you agree to our use of cookies.
More information

Languages

      This page is not available in other languages.

      Safer nicotine wiki
      • Creative Commons Attribution-ShareAlike
      • Powered by MediaWiki
      • Monitored by WikiApiary
      • ipv6 ready
      • Powered by Semantic MediaWiki
      • This page was last modified on 2 January 2022, at 16:23. Warning: Page may not contain recent updates.
      • Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
      • Privacy policy
      • About Safer nicotine wiki
      • Disclaimers
      • Terms of Use
      • Desktop
      • Data access
      • Developers
      • Statistics
      • Cookie statement