Template:InchDec: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 2: | Line 2: | ||
{{#vardefine:mm|{{#expr: {{{1}}} * 25.4 round 1}} }} | {{#vardefine:mm|{{#expr: {{{1}}} * 25.4 round 1}} }} | ||
{{#vardefine:whole|{{#expr: {{{1}}} round 0}} }} | {{#vardefine:whole|{{#expr: {{{1}}} round 0}} }} | ||
{{#vardefine:float|{{#expr: {{{1}}} - {{#var:whole}} }} }} | {{#vardefine:float|{{#expr: {{{1}}} - 0{{#var:whole}} }} }} | ||
{{#var:float}} | |||
{{#var:whole}} | {{#var:whole}} | ||
<!--{{#ifeq:{{#var:float}}|0.0625|1/16"}} ({{{1}}} in, {{#var:mm}} mm) | <!--{{#ifeq:{{#var:float}}|0.0625|1/16"}} ({{{1}}} in, {{#var:mm}} mm) |
Revision as of 04:41, 18 February 2016
Expression error: Unrecognized punctuation character "{".
Expression error: Unrecognized punctuation character "{".
Documentation icon Template documentation[view] [edit] [history] [purge]
Usage
This template takes a decimal length value (in inches) as input and displays this same value, plus the fractional and mm (millimetre) equivalents.
Example Output: 7 3/8" (7.375 in, 187.3 mm)
Example Usage
Enter the Decimal value to be displayed.
{{InchDec|7.375}}
Blank template
{{InchDec|}}
Example Output
Input:
{{InchDec|7.375}}
Output:
0.375
7
The above documentation is transcluded from Template:InchDec/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |