Template:InchDec: Difference between revisions

From The Freestyle Knowledge Base
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 4: Line 4:
{{#vardefine:float|{{#expr: {{{1}}} - 0{{#var:whole}} }} }}
{{#vardefine:float|{{#expr: {{{1}}} - 0{{#var:whole}} }} }}


{{#var:whole}} 1/{{#expr: 1 / {{#var:float}}}}
{{#var:whole}} 1/{{#expr: 1 / {{#var:float}}}}"
 
<!--{{#ifeq:{{#var:float}}|0.0625|1/16"}} ({{{1}}} in, {{#var:mm}} mm)
{{#ifeq:{{#var:float}}|0.125|1/8"}} ({{{1}}} in, {{#var:mm}} mm)
{{#ifeq:{{#var:float}}|0.1875|3/16"}} ({{{1}}} in, {{#var:mm}} mm)
{{#ifeq:{{#var:float}}|0.25|1/4"}} ({{{1}}} in, {{#var:mm}} mm)
{{#ifeq:{{#var:float}}|0.3125|5/16"}} ({{{1}}} in, {{#var:mm}} mm)
{{#ifeq:{{#var:float}}|0.375|3/8"}} ({{{1}}} in, {{#var:mm}} mm)
{{#ifeq:{{#var:float}}|0.4375|7/16"}} ({{{1}}} in, {{#var:mm}} mm)
{{#ifeq:{{#var:float}}|0.5|1/2"}} ({{{1}}} in, {{#var:mm}} mm)
{{#ifeq:{{#var:float}}|0.5625|9/16"}} ({{{1}}} in, {{#var:mm}} mm)
{{#ifeq:{{#var:float}}|0.625|5/8"}} ({{{1}}} in, {{#var:mm}} mm)
{{#ifeq:{{#var:float}}|0.6875|11/16"}} ({{{1}}} in, {{#var:mm}} mm)
{{#ifeq:{{#var:float}}|0.75|3/4"}} ({{{1}}} in, {{#var:mm}} mm)
{{#ifeq:{{#var:float}}|0.8125|13/16"}} ({{{1}}} in, {{#var:mm}} mm)
{{#ifeq:{{#var:float}}|0.875|7/8"}} ({{{1}}} in, {{#var:mm}} mm)
{{#ifeq:{{#var:float}}|0.9375|15/16"}} ({{{1}}} in, {{#var:mm}} mm)
-->


<noinclude>
<noinclude>

Revision as of 04:47, 18 February 2016



Expression error: Unrecognized punctuation character "{". 1/Expression error: Unexpected < operator."


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:



7 1/2.6666666666667"