Difference between revisions of "Template:Millimeter"

From Teampedia
Jump to: navigation, search
Line 1: Line 1:
 
<noinclude>;Usage:
 
<noinclude>;Usage:
:<nowiki>{{in to mm | num | abbr | spell | precision | wiki}}</nowiki>
+
:<nowiki>{{mm to in | num | abbr | spell | precision | wiki}}</nowiki>
  
 
;Examples
 
;Examples
:''[[WP:MOSNUM#Units of measurement|Manual of Style]] notation'': <nowiki>{{in to mm|35}}</nowiki>&nbsp;&rarr; {{in to mm|35}}
+
:''[[WP:MOSNUM#Units of measurement|Manual of Style]] notation'': <nowiki>{{millimeter|100}}</nowiki>&nbsp;&rarr; {{millimeter|100}}
:''Short notation'': <nowiki>{{in to mm|35|abbr=yes}}</nowiki>&nbsp;&rarr; {{in to mm|35|abbr=yes}}
+
:''Short notation'': <nowiki>{{mm to in|100|abbr=yes}}</nowiki>&nbsp;&rarr; {{millimeter|100|abbr=yes}}
:''Full notation'': <nowiki>{{in to mm|num=35|abbr=no|spell=Commonwealth|precision=2|wiki=yes}}</nowiki>&nbsp;&rarr; {{in to mm|num=35|abbr=no|spell=Commonwealth|precision=2|wiki=yes}}
+
:''Full notation'': <nowiki>{{mm to in|num=100|abbr=no|spell=Commonwealth|precision=2|wiki=yes}}</nowiki>&nbsp;&rarr; {{mm to in|num=100|abbr=no|spell=Commonwealth|precision=2|wiki=yes}}
  
 
''Italicized'' parameters are optional:
 
''Italicized'' parameters are optional:
*'''num''' is a required parameter, which specifies the number of inches to be converted to millimeters.  Please do not format this parameter; i.e., use 1234 instead of 1,234.
+
*'''num''' is a required parameter, which specifies the number of millimeters to be converted to inches.  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]] (inches, mm); ''yes'' will show the abbreviated names of the units (in, mm); and ''no'' will show the full names of the units (inches, millimeters).  The default value is ''mos''.
+
*'''''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]] (millimeters, in); ''yes'' will show the abbreviated names of the units (mm, in); and ''no'' will show the full names of the units (millimeters, inches).  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 "millimeters", and ''Commonwealth''&mdash;"millimetres".  The default value is ''American''.
 
*'''''spell''''' can take values of ''American'' or ''Commonwealth'' and is only meaningful when ''abbr'' is set to ''no''.  ''American'' will use "millimeters", and ''Commonwealth''&mdash;"millimetres".  The default value is ''American''.
 
*'''''precision''''' is the number of decimal digits in the converted value.  The default value is&nbsp;1.
 
*'''''precision''''' is the number of decimal digits in the converted value.  The default value is&nbsp;1.
 
*'''''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''.
 
*'''''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}}}}}}}&nbsp;{{#ifexpr:({{#ifeq:{{LC:{{{abbr|mos}}}}}|mos|1|0}} OR {{#ifeq:{{LC:{{{abbr|mos}}}}}|no|1|0}})|{{#ifeq:{{LC:{{{wiki|no}}}}}|yes|[[inch]]es|inches}}|{{#ifeq:{{LC:{{{wiki|no}}}}}|yes|[[inch|in]]|in}}}} ({{FORMATNUM:{{#expr:{{#if:{{{num|}}}|{{{num}}}|{{{1}}}}}*25.4 round {{{precision|1}}}}}}}&nbsp;{{#ifeq:{{LC:{{{abbr|mos}}}}}|no|{{#ifeq:{{LC:{{{spell|american}}}}}|commonwealth|{{#ifeq:{{LC:{{{wiki|no}}}}}|no|millimetres|[[millimetre]]s}}|{{#ifeq:{{LC:{{{wiki|no}}}}}|no|millimeters|[[millimetre|millimeters]]}}}}|{{#ifeq:{{LC:{{{wiki|no}}}}}|no|mm|[[millimetre|mm]]}}}})</includeonly><noinclude>
+
Capitalization of the parameters is unimportant.</noinclude><includeonly>{{FORMATNUM:{{#if:{{{num|}}}|{{{num}}}|{{{1}}}}}}}&nbsp;{{#ifexpr:({{#ifeq:{{LC:{{{abbr|mos}}}}}|mos|1|0}} OR {{#ifeq:{{LC:{{{abbr|mos}}}}}|no|1|0}})|{{#ifeq:{{LC:{{{spell|american}}}}}|american|{{#ifeq:{{LC:{{{wiki|no}}}}}|yes|[[millimetre|millimeters]]|millimeters}}|{{#ifeq:{{LC:{{{wiki|no}}}}}|yes|[[millimetre]]s|millimetres}}}}|{{#ifeq:{{LC:{{{wiki|no}}}}}|yes|[[millimetre|mm]]|mm}}}} ({{FORMATNUM:{{#expr:{{#if:{{{num|}}}|{{{num}}}|{{{1}}}}}/25.4 round {{{precision|1}}}}}}}&nbsp;{{#ifeq:{{LC:{{{abbr|mos}}}}}|no|{{#ifeq:{{LC:{{{wiki|no}}}}}|yes|[[inch]]es|inches}}|{{#ifeq:{{LC:{{{wiki|no}}}}}|yes|[[inch|in]]|in}}}})</includeonly><noinclude>
 
==See also==
 
==See also==
*{{tl|mm to in}}
+
*{{tl|in to mm}}
  
 
[[Category:Conversion templates|{{PAGENAME}}]]
 
[[Category:Conversion templates|{{PAGENAME}}]]
 
</noinclude>
 
</noinclude>
 +
 
{{Documentation}}
 
{{Documentation}}

Revision as of 00:25, 1 March 2020

Usage
{{mm to in | num | abbr | spell | precision | wiki}}
Examples
Manual of Style notation: {{millimeter|100}} → 100 millimeters (3.9 in)
[view] [edit] [history] [purge] Documentation icon Template documentation

Usage

  • {{millimeter|2}} or {{millimeter|2}} - will show as : Template loop detected: Template:Millimeter

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:Millimeter/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.
Short notation: {{mm to in|100|abbr=yes}} → 100 mm (3.9 in)
[view] [edit] [history] [purge] Documentation icon Template documentation

Usage

  • {{millimeter|2}} or {{millimeter|2}} - will show as : Template loop detected: Template:Millimeter

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:Millimeter/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.
Full notation: {{mm to in|num=100|abbr=no|spell=Commonwealth|precision=2|wiki=yes}} → Template:Mm to in

Italicized parameters are optional:

  • num is a required parameter, which specifies the number of millimeters to be converted to inches. 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 (millimeters, in); yes will show the abbreviated names of the units (mm, in); and no will show the full names of the units (millimeters, inches). 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 "millimeters", and Commonwealth—"millimetres". The default value is American.
  • precision is the number of decimal digits in the converted value. The default value is 1.
  • 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


[view] [edit] [history] [purge] Documentation icon Template documentation

Usage

  • {{millimeter|2}} or {{millimeter|2}} - will show as : 2 millimeters (0.1 in)

Template loop detected: Template:Documentation

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:Millimeter/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.