Template:InchFrac: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
<!-- in = mm ÷ 25.4 --> | <!-- in = mm ÷ 25.4 --> | ||
{{#vardefine: | {{#vardefine:inchDecimal|{{#expr: {{{1}}} + {{{2}}}}} }} | ||
{{#vardefine:inchFraction|{{{1}}} {{{2}}} }} | |||
{{#vardefine:mm|{{#expr: {{#var:decimal}} * 25.4 round 1}} }} | |||
{| class="wikitable" | {| class="wikitable" | ||
! style="text-align:left;"| Inches !! Millimetre | ! style="text-align:left;"| Inches (Frac) !! Inches (Dec) !! Millimetre | ||
|- | |- | ||
| {{ | | {{#var:fraction}}" || {{#var:decimal}}" || {{#var:mm}} mm | ||
|- | |- | ||
|} | |} |
Revision as of 05:12, 18 February 2016
Inches (Frac) | Inches (Dec) | Millimetre |
---|---|---|
" | " | Expression error: Unexpected * operator. mm |
Documentation icon Template documentation[view] [edit] [history] [purge]
Usage
This template takes a fractional length value (in inches) as two inputs (the whole number, and the fraction) and displays this same value, plus the decimal and mm (millimetre) equivalents.
Example Output: 7 3/8" (7.375 in, 187.3 mm)
Example Usage
Enter the Decimal value to be displayed.
{{InchFrac|7|3/8}}
Blank template
{{InchFrac|}}
The above documentation is transcluded from Template:InchFrac/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |