Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Vrienden Universe
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Template:Convinfobox/doc
Template
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Documentation subpage}} {{high-use}} {{Lua|Module:ConvertIB}} <!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE --> This template is a frontend for {{tl|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 {{tl|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 {{tlf|convert}}. Named parameters are the same as used by {{tlf|convert}}. This template differs from {{tlf|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). 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. * <code><nowiki>{{convinfobox|100|m2||sqft}}</nowiki></code> β {{convinfobox|100|m2||sqft}} * <code><nowiki>{{convinfobox||m2|100|sqft}}</nowiki></code> β {{convinfobox||m2|100|sqft}} ==Dual conversions== Dual conversions may be performed by adding a fifth (possibly blank) and sixth unnamed parameter. * <code><nowiki>{{convinfobox|375|ml||impoz||USoz}}</nowiki></code> β {{convinfobox|375|ml||impoz||USoz}} * <code><nowiki>{{convinfobox||ml|40|impoz||USoz}}</nowiki></code> β {{convinfobox||ml|40|impoz||USoz}} * <code><nowiki>{{convinfobox||ml||impoz|32|USoz}}</nowiki></code> β {{convinfobox||ml||impoz|32|USoz}} ==Paired units== Length may be expressed in feet and inches. * <code><nowiki>{{convinfobox|180|cm||ft||in}}</nowiki></code> β {{convinfobox|180|cm||ft||in}} * <code><nowiki>{{convinfobox||cm|5|ft||in}}</nowiki></code> β {{convinfobox||cm|5|ft||in}} * <code><nowiki>{{convinfobox||cm||ft|120|in}}</nowiki></code> β {{convinfobox||cm||ft|120|in}} * <code><nowiki>{{convinfobox||cm|5|ft|6|in}}</nowiki></code> β {{convinfobox||cm|5|ft|6|in}} * <code><nowiki>{{convinfobox||ft||in|180|cm}}</nowiki></code> β {{convinfobox||ft||in|180|cm}} * <code><nowiki>{{convinfobox|5|ft||in||cm}}</nowiki></code> β {{convinfobox|5|ft||in||cm}} * <code><nowiki>{{convinfobox||ft|120|in||cm}}</nowiki></code> β {{convinfobox||ft|120|in||cm}} * <code><nowiki>{{convinfobox|5|ft|6|in||cm}}</nowiki></code> β {{convinfobox|5|ft|6|in||cm}} Similarly, mass may be expressed in pounds and ounces. * <code><nowiki>{{convinfobox|8.5|kg||lb||oz}}</nowiki></code> β {{convinfobox|8.5|kg||lb||oz}} * <code><nowiki>{{convinfobox||kg|4|lb|3|oz}}</nowiki></code> β {{convinfobox||kg|4|lb|3|oz}} Mass may also be expressed in stone and pounds. * <code><nowiki>{{convinfobox|65|kg||st||lb}}</nowiki></code> β {{convinfobox|65|kg||st||lb}} * <code><nowiki>{{convinfobox||kg|10|st||lb}}</nowiki></code> β {{convinfobox||kg|10|st||lb}} * <code><nowiki>{{convinfobox||kg|10|st|7|lb}}</nowiki></code> β {{convinfobox||kg|10|st|7|lb}} * <code><nowiki>{{convinfobox||kg||st|145|lb}}</nowiki></code> β {{convinfobox||kg||st|145|lb}} ==Specifying more than one value== The template currently bases conversions on the first non-blank numerical value ignoring any secondary or tertiary values. * <code><nowiki>{{convinfobox|100|m2|100|sqft}}</nowiki></code> β {{convinfobox|100|m2|100|sqft}} * <code><nowiki>{{convinfobox|375|ml|40|impoz||USoz}}</nowiki></code> β {{convinfobox|375|ml|40|impoz||USoz}} * <code><nowiki>{{convinfobox|375|ml||impoz|32|USoz}}</nowiki></code> β {{convinfobox|375|ml||impoz|32|USoz}} * <code><nowiki>{{convinfobox||ml|40|impoz|32|USoz}}</nowiki></code> β {{convinfobox||ml|40|impoz|32|USoz}} ==Ranges== The template will accept ranges as well. * <code><nowiki>{{convinfobox|100-200|m||ft}}</nowiki></code> β {{convinfobox|100-200|m||ft}} * <code><nowiki>{{convinfobox|100 to 200|mi||km}}</nowiki></code> β {{convinfobox|100 to 200|mi||km}} ==Rounding== As with {{tlf|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 {{para|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. * <code><nowiki>{{convinfobox|100|m2||sqft|4}}</nowiki></code> β {{convinfobox|100|m2||sqft|4}} * <code><nowiki>{{convinfobox|100|m2||sqft|sigfig=4}}</nowiki></code> β {{convinfobox|100|m2||sqft|sigfig=4}} * <code><nowiki>{{convinfobox||ml|40|impoz||USoz|2}}</nowiki></code> β {{convinfobox||ml|40|impoz||USoz|2}} * <code><nowiki>{{convinfobox||ml|40|impoz||USoz|sigfig=3}}</nowiki></code> β {{convinfobox||ml|40|impoz||USoz|sigfig=3}} * <code><nowiki>{{convinfobox||kg|10|st|7|lb|3}}</nowiki></code> β {{convinfobox||kg|10|st|7|lb|3}} * <code><nowiki>{{convinfobox||kg|10|st|7|lb|sigfig=5}}</nowiki></code> β {{convinfobox||kg|10|st|7|lb|sigfig=5}} Specify precision "0" to prevent rounding of values ending in zero: * kilograms (kg) ** with "0": <code><nowiki>{{convinfobox|110|kg||lb|0}}</nowiki></code> β {{convinfobox|110|kg||lb|0}} ** without: <code><nowiki>{{convinfobox|110|kg||lb}}</nowiki></code> β {{convinfobox|110|kg||lb}} * pounds (lb) ** with "0": <code><nowiki>{{convinfobox||kg|240|lb|0}}</nowiki></code> β {{convinfobox||kg|240|lb|0}} ** without: <code><nowiki>{{convinfobox||kg|240|lb}}</nowiki></code> β {{convinfobox||kg|240|lb}} * metres (m) ** with "0": <code><nowiki>{{convinfobox|100|m||ft|0}}</nowiki></code> β {{convinfobox|100|m||ft|0}} ** without: <code><nowiki>{{convinfobox|100|m||ft}}</nowiki></code> β {{convinfobox|100|m||ft}} * inches (in) ** with "0": <code><nowiki>{{convinfobox||cm|100|in|0}}</nowiki></code> β {{convinfobox||cm|100|in|0}} ** without: <code><nowiki>{{convinfobox||cm|100|in}}</nowiki></code> β {{convinfobox||cm|100|in}} ==Leaving all numerical fields blank== If all numerical value fields are left blank the template returns nothing. * <code><nowiki>{{convinfobox||m2||sqft}}</nowiki></code> β {{convinfobox||m2||sqft}} * <code><nowiki>{{convinfobox||ml||impoz||USoz}}</nowiki></code> β {{convinfobox||ml||impoz||USoz}} ==See also==
Summary:
Please note that all contributions to Vrienden Universe may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Vrienden Universe:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Pages included on this page:
Template:Convert
(
edit
)
Template:Convinfobox
(
edit
)
Template:Documentation subpage
(
edit
)
Template:High-use
(
edit
)
Template:Lua
(
edit
)
Template:Mbox
(
edit
)
Template:Para
(
edit
)
Template:Parameter
(
edit
)
Template:Strong
(
edit
)
Template:Template link
(
edit
)
Template:Template link with link off
(
edit
)
Template:Terminate sentence
(
edit
)
Template:Tl
(
edit
)
Template:Tlf
(
edit
)
Module:Arguments
(
edit
)
Module:Convert
(
edit
)
Module:Convert/data
(
edit
)
Module:Convert/text
(
edit
)
Module:ConvertIB
(
edit
)
Module:ConvertIB/data
(
edit
)
Module:High-use
(
edit
)
Module:List
(
edit
)
Module:Lua banner
(
edit
)
Module:Message box
(
edit
)
Module:Message box/configuration
(
edit
)
Module:Message box/ombox.css
(
edit
)
Module:TableTools
(
edit
)
Module:Template link general
(
edit
)
Module:Text
(
edit
)
Module:Text/data
(
edit
)
Module:Transclusion count
(
edit
)
Module:Transclusion count/data/C
(
edit
)
Module:Yesno
(
edit
)
This page is a member of 2 hidden categories:
Category:Pages with script errors
Category:Pages with broken file links
Search
Search
Editing
Template:Convinfobox/doc
Add topic