Template:Frac/doc: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Arthur Rubin
fix description
meta>Arthur Rubin
produce current code
Line 3: Line 3:
This template builds nicer-looking [[common fraction]]s. It takes one, two or three parameters: the optional integer (may be signed), the optional numerator and the required denominator; in this order. Please '''don't''' substitute it.
This template builds nicer-looking [[common fraction]]s. It takes one, two or three parameters: the optional integer (may be signed), the optional numerator and the required denominator; in this order. Please '''don't''' substitute it.
; <code><nowiki>{{frac|A|B|C}}</nowiki></code>: {{frac|A|B|C}} (integer, numerator and denominator)
; <code><nowiki>{{frac|A|B|C}}</nowiki></code>: {{frac|A|B|C}} (integer, numerator and denominator)
: <code><span class="frac">{{#if:C
: <code><span class="frac">A<sup>&nbsp;B</sup>⁄<sub>C</sub></span></code>
|A<sup>&nbsp;B</sup>⁄<sub>C</sub>
|{{#if:B
  |<sup>A</sup>⁄<sub>B</sub>
  |<sup>1</sup>⁄<sub>A</sub>
}}
}}</span></code>
; <code><nowiki>{{frac|A|B}}</nowiki></code>: {{frac|A|B}} (numerator and denominator)
; <code><nowiki>{{frac|A|B}}</nowiki></code>: {{frac|A|B}} (numerator and denominator)
: <code><span class="frac">{{#if:
: <code><span class="frac"><sup>A</sup>⁄<sub>B</sub></span></code>
|A<sup>&nbsp;B</sup>⁄<sub>{{{3}}}</sub>
|{{#if:B
  |<sup>A</sup>⁄<sub>B</sub>
  |<sup>1</sup>⁄<sub>A</sub>
}}
}}</span></code>
; <code><nowiki>{{frac|A}}</nowiki></code>: {{frac|A}} (denominator only)
; <code><nowiki>{{frac|A}}</nowiki></code>: {{frac|A}} (denominator only)
: <code><span class="frac">{{#if:
: <code><span class="frac"><sup>1</sup>⁄<sub>A</sub></span></code>
|A<sup>&nbsp;{{{2}}}</sup>⁄<sub>{{{3}}}</sub>
|{{#if:
  |<sup>A</sup>⁄<sub>{{{2}}}</sub>
  |<sup>1</sup>⁄<sub>A</sub>
}}
}}</span></code>


Examples:
Examples:

Revision as of 21:57, 19 July 2010

This template builds nicer-looking common fractions. It takes one, two or three parameters: the optional integer (may be signed), the optional numerator and the required denominator; in this order. Please don't substitute it.

{{frac|A|B|C}}
A BC (integer, numerator and denominator)
A BC
{{frac|A|B}}
AB (numerator and denominator)
AB
{{frac|A}}
1A (denominator only)
1A

Examples:

12131418121323142434182838485868781163165167169161116131615165322732

To allow numerical sorting of a column containing fractions, use {{sortfrac}} instead. It is a combination of this template and {{sort}}.

See also