Template:InchFrac: Difference between revisions

From The Freestyle Knowledge Base
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
<!-- in = mm ÷ 25.4 -->
<!-- in = mm ÷ 25.4 -->
{{#vardefine:float|{{#expr: {{{1}}} + {{{2}}}}} }}
{{#vardefine:inchDecimal|{{#expr: {{{1}}} + {{{2}}}}} }}
{{{1}}} {{{2}}}" ({{#var:float}} in, {{#expr: {{{1}}} * 25.4 round 1}} mm)
{{#vardefine:inchFraction|{{{1}}} {{{2}}} }}
{{#vardefine:mm|{{#expr: {{#var:inchDecimal}} * 25.4 round 1}} }}
{{#var:inchFraction}}", {{#var:inchDecimal}}", {{#var:mm}} mm


{{#var:float}}
<noinclude>
{{Documentation}}
[[Category:Template]]
</noinclude>

Latest revision as of 17:09, 19 February 2016



{{{1}}} {{{2}}}", Expression error: Unrecognized punctuation character "{".", 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|}}