Difference between revisions of "Template:Pound"
From Teampedia
(Created page with "{{convert|{{{1|10}}}|lb|kg|abbr=on}}<noinclude> {{documentation}} Category:Formatting and function templates </noinclude>") |
|||
Line 1: | Line 1: | ||
− | {{ | + | <noinclude>;Usage: |
+ | :<nowiki>{{pound | num | abbr | spell | precision | wiki}}</nowiki> | ||
+ | |||
+ | ;Examples: | ||
+ | :''[[WP:MOSNUM#Units of measurement|Manual of Style]] notation'':<nowiki>{{pound|100}}</nowiki> → {{pound|100}} | ||
+ | :''Short notation'': <nowiki>{{pound|100|abbr=yes}}</nowiki> → {{pound|100|abbr=yes}} | ||
+ | :''Full notation'': <nowiki>{{lb to kg|num=100|abbr=no|spell=Commonwealth|precision=2|wiki=yes}}</nowiki> → {{pound|num=100|abbr=no|spell=Commonwealth|precision=2|wiki=yes}} | ||
+ | |||
+ | ''Italicized'' parameters are optional: | ||
+ | *'''num''' is a required parameter, which specifies the number of pounds to be converted to kilograms. Please do not format this parameter; i.e., use 1234 instead of 1,234. | ||
+ | *'''''abbr''''' can take values of either ''mos'', ''yes'', or ''no''. ''Mos'' will show the names of the units as specified in the [[WP:MOSNUM#Units of measurement|Manual of Style for dates and numbers]] (pounds, kg); ''yes'' will show the abbreviated names of the units (lb, kg); and ''no'' will show the full names of the units (pounds, kilograms). The default value is ''mos''. | ||
+ | *'''''spell''''' can take values of ''American'' or ''Commonwealth'' and is only meaningful when ''abbr'' is set to ''no''. ''American'' will use "kilograms", and ''Commonwealth''—"kilogrammes". The default value is ''American''. | ||
+ | *'''''precision''''' is the number of decimal digits in the converted value. The default value is 0. | ||
+ | *'''''wiki''''' specifies whether the names of the units should be wikified or not and can take values of either ''yes'' or ''no''. The default value is ''no''. | ||
+ | |||
+ | Capitalization of the parameters is unimportant.</noinclude><includeonly>{{FORMATNUM:{{#if:{{{num|}}}|{{{num}}}|{{{1}}}}}}} {{#ifexpr:({{#ifeq:{{LC:{{{abbr|mos}}}}}|mos|1|0}} OR {{#ifeq:{{LC:{{{abbr|mos}}}}}|no|1|0}})|{{#ifeq:{{LC:{{{wiki|no}}}}}|yes|[[pound (mass)|pounds]]|pounds}}|{{#ifeq:{{LC:{{{wiki|no}}}}}|yes|[[pound (mass)|lb]]|lb}}}} ({{FORMATNUM:{{#expr:{{#if:{{{num|}}}|{{{num}}}|{{{1}}}}}*0.45359237 round {{{precision|0}}}}}}} {{#ifeq:{{LC:{{{abbr|mos}}}}}|no|{{#ifeq:{{LC:{{{spell|american}}}}}|commonwealth|{{#ifeq:{{LC:{{{wiki|no}}}}}|no|kilogrammes|[[kilogram]]mes}}|{{#ifeq:{{LC:{{{wiki|no}}}}}|no|kilograms|[[kilogram]]s}}}}|{{#ifeq:{{LC:{{{wiki|no}}}}}|no|kg|[[kilogram|kg]]}}}})</includeonly><noinclude> | ||
+ | ==See also== | ||
+ | *{{tl|convert}} | ||
+ | |||
+ | [[Category:Conversion templates|{{PAGENAME}}]] | ||
+ | </noinclude> | ||
+ | <noinclude> | ||
{{documentation}} | {{documentation}} | ||
[[Category:Formatting and function templates]] | [[Category:Formatting and function templates]] | ||
</noinclude> | </noinclude> |
Latest revision as of 19:08, 29 February 2020
- Usage
- {{pound | num | abbr | spell | precision | wiki}}
- Examples
- Manual of Style notation:{{pound|100}} → 100 pounds (45 kg)
- Short notation: {{pound|100|abbr=yes}} → 100 lb (45 kg)
- Full notation: {{lb to kg|num=100|abbr=no|spell=Commonwealth|precision=2|wiki=yes}} → 100 pounds (45.36 kilogrammes)
Italicized parameters are optional:
- num is a required parameter, which specifies the number of pounds to be converted to kilograms. Please do not format this parameter; i.e., use 1234 instead of 1,234.
- abbr can take values of either mos, yes, or no. Mos will show the names of the units as specified in the Manual of Style for dates and numbers (pounds, kg); yes will show the abbreviated names of the units (lb, kg); and no will show the full names of the units (pounds, kilograms). The default value is mos.
- spell can take values of American or Commonwealth and is only meaningful when abbr is set to no. American will use "kilograms", and Commonwealth—"kilogrammes". The default value is American.
- precision is the number of decimal digits in the converted value. The default value is 0.
- wiki specifies whether the names of the units should be wikified or not and can take values of either yes or no. The default value is no.
Capitalization of the parameters is unimportant.
See also
- {{convert}}
Usage
- {{Pound|2}} or {{Pound|2}} - will show as : 2 pounds (1 kg)
See also
- Wikivoyage:Units
- {{convert}} - from which this template is built; but this one removes the need to know full syntax and ensure consistent formatting throughout the site.
The above documentation is transcluded from Template:Pound/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Please add categories and interwikis to the /doc subpage. Subpages of this template.
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Please add categories and interwikis to the /doc subpage. Subpages of this template.