Template:Frac: Difference between revisions

From Vigyanwiki
Template>Crissov
mNo edit summary
Template>MSGJ
(prettify code)
Line 1: Line 1:
<includeonly><span class="template-frac">{{#if:{{{3|}}}|{{{1}}}&thinsp;{{#switch:{{{3}}}
<span class="template-frac">{{#if:{{{3|}}}
| 2 = {{#ifeq:{{{2}}}
|{{{1}}}&thinsp;{{#switch:{{{3}}}
   | 1 |½
  |2 = {{#ifeq:{{{2}}}|1
  |{{{2}}}&frasl;{{{3}}}
  |½
  |{{{2}}}&frasl;{{{3}}}
  }}
   |3 = {{#switch:{{{2}}}
  |1=⅓
  |2=⅔
  |{{{2}}}&frasl;{{{3}}}
   }}
   }}
| 3 = {{#switch:{{{2}}}
  |4 = {{#switch:{{{2}}}
  | 1 =
  |1=¼
  | 2 =
  |2=½
  |{{{2}}}&frasl;{{{3}}}
  |3=¾
  |{{{2}}}&frasl;{{{3}}}
   }}
   }}
| 4 = {{#switch:{{{2}}}
  |5 = {{#switch:{{{2}}}
  | 1 =¼
  |1=
  | 2 =½
  |2=
  | 3 =¾
  |3=
  |{{{2}}}&frasl;{{{3}}}
  |4=⅘
  |{{{2}}}&frasl;{{{3}}}
   }}
   }}
| 5 = {{#switch:{{{2}}}
  |6 = {{#switch:{{{2}}}
  | 1 =
  |1=
  | 2 =
  |2=
  | 3 =
  |3=½
  | 4 =
  |4=
  |{{{2}}}&frasl;{{{3}}}
  |5=⅚
  |{{{2}}}&frasl;{{{3}}}
   }}
   }}
| 6 = {{#switch:{{{2}}}
  |8 = {{#switch:{{{2}}}
  | 1 =
  |1=
  | 2 =
  |2=¼
  | 3 =½
  |3=
  | 4 =
  |4=½
  | 5 =
  |5=
  |{{{2}}}&frasl;{{{3}}}
  |6=¾
  |7=⅞
  |{{{2}}}&frasl;{{{3}}}
   }}
   }}
| 8 = {{#switch:{{{2}}}
  | 1 =⅛
  | 2 =¼
  | 3 =⅜
  | 4 =½
  | 5 =⅝
  | 6 =¾
  | 7 =⅞
   |{{{2}}}&frasl;{{{3}}}
   |{{{2}}}&frasl;{{{3}}}
}}
|{{#if:{{{2|}}}
  |{{#switch:{{{2}}}
  |2 = {{#ifeq:{{{1}}}|1
    |½
    |{{{1}}}&frasl;{{{2}}}
  }}
  |3 = {{#switch:{{{1}}}
    |1=⅓
    |2=⅔
    |{{{1}}}&frasl;{{{2}}}
  }}
  |4 = {{#switch:{{{1}}}
    |1=¼
    |2=½
    |3=¾
    |{{{1}}}&frasl;{{{2}}}
  }}
  |5 = {{#switch:{{{1}}}
    |1=⅕
    |2=⅖
    |3=⅗
    |4=⅘
    |{{{1}}}&frasl;{{{2}}}
  }}
  |6 = {{#switch:{{{1}}}
    |1=⅙
    |2=⅓
    |3=½
    |4=⅔
    |5=⅚
    |{{{1}}}&frasl;{{{2}}}
  }}
  |8 = {{#switch:{{{1}}}
    |1=⅛
    |2=¼
    |3=⅜
    |4=½
    |5=⅝
    |6=¾
    |7=⅞
    |{{{1}}}&frasl;{{{2}}}
  }}
  |{{{1}}}&frasl;{{{2}}}
   }}
   }}
| {{{2}}}&frasl;{{{3}}}
  |{{#switch:{{{1}}}
}}|<noinclude>#else:
  |2=½
</noinclude>{{#if:{{{2|}}}|<noinclude>Complex:
  |3=⅓
</noinclude>{{#switch:{{{2}}}
  |4=¼
| 2 = {{#ifeq:{{{1}}}
  |5=⅕
  | 1 | ½
  |6=⅙
  | {{{1}}}&frasl;{{{2}}}
  |8=⅛
  }}
  |{{{1}}}
| 3 = {{#switch:{{{1}}}
  | 1 = ⅓
  | 2 = ⅔
  | {{{1}}}&frasl;{{{2}}}
  }}
| 4 = {{#switch:{{{1}}}
  | 1 = ¼
  | 2 = ½
  | 3 = ¾
  | {{{1}}}&frasl;{{{2}}}
  }}
| 5 = {{#switch:{{{1}}}
  | 1 = ⅕
  | 2 = ⅖
  | 3 = ⅗
  | 4 = ⅘
  | {{{1}}}&frasl;{{{2}}}
  }}
| 6 = {{#switch:{{{1}}}
  | 1 = ⅙
  | 2 = ⅓
  | 3 = ½
  | 4 = ⅔
  | 5 = ⅚
  | {{{1}}}&frasl;{{{2}}}
  }}
| 8 = {{#switch:{{{1}}}
  | 1 = ⅛
  | 2 = ¼
  | 3 = ⅜
  | 4 = ½
  | 5 = ⅝
  | 6 = ¾
  | 7 = ⅞
  | {{{1}}}&frasl;{{{2}}}
   }}
   }}
| {{{1}}}&frasl;{{{2}}}
}}
}}|<noinclude>#else:
}}</span><noinclude>
</noinclude>{{#switch:{{{1}}}|2=½|3=⅓|4=¼|5=⅕|6=⅙|8=⅛|⅟{{{1}}}}}}}}}</span></includeonly><noinclude>
{{documentation}}
{{documentation}}
</noinclude>
</noinclude>

Revision as of 19:26, 2 July 2010

⅟{{{1}}}

Template documentation