Frac: Difference between revisions

From Vigyanwiki
Template>Crissov
(simpler code that should yield identical results)
Template>Crissov
(1/7, 1/9, 1/10, ditch ⁄, CSS3 font-variant-numeric: diagonal-fractions)
Line 1: Line 1:
<span class="frac nowrap">{{#if:{{{3|{{{2|}}}}}}
<span class="frac nowrap" style="font-variant-numeric: diagonal-fractions;">{{#if:{{{3|{{{2|}}}}}}
|{{#if: {{{3|}}} |{{{1}}}&thinsp;|}}{{#switch:
|{{#if: {{{3|}}} |{{{1}}}&thinsp;|}}{{#switch:
   {{#expr: {{#if: {{{3|}}} | {{{2}}}/{{{3}}} | {{{1}}}/{{{2}}} }} }}
   {{#expr: {{#if: {{{3|}}} | {{{2}}}/{{{3}}} | {{{1}}}/{{{2}}} }} }}
Line 17: Line 17:
   |{{#expr:5/8}} = ⅝
   |{{#expr:5/8}} = ⅝
   |{{#expr:7/8}} = ⅞
   |{{#expr:7/8}} = ⅞
   |#default={{#if:{{{3|}}} | {{{2}}}{{{3}}} | {{{1}}}{{{2}}} }}
   |#default={{#if:{{{3|}}} | {{{2}}}/{{{3}}} | {{{1}}}/{{{2}}} }}
  }}
  }}
|{{#switch:{{{1}}}
|{{#switch:{{{1}}}
   |2=½
   |2 = ½
   |3=⅓
   |3 = ⅓
   |4=¼
   |4 = ¼
   |5=⅕
   |5 = ⅕
   |6=⅙
   |6 = ⅙
   |8=⅛
  |7 = ⅐
   |#default=1⁄{{{1|x}}}
   |8 = ⅛
  |9 = ⅑
  |10= ⅒
   |#default={{{1|x}}}
  }}
  }}
}}</span><noinclude>
}}</span><noinclude>
{{Documentation}}
{{Documentation}}
</noinclude>
</noinclude>

Revision as of 19:07, 28 December 2013

⅟x

Documentation