Template:Fraction: Difference between revisions
Sections
wikipedia>GoldRingChip m {{Zero width space}} |
wikipedia>RMCD bot Notifying subject page of move discussion on Template talk:Frac |
||
Line 1: | Line 1: | ||
{{Zero width space}}<!-- zero-width space; might be removable after introduction of RemexHTML --><span class="frac nowrap">{{#if:{{{3|}}} | <noinclude>{{User:RMCD bot/subject notice|1=Template:Fraction|2=Template talk:Frac#Requested move 21 March 2021 }} | ||
</noinclude>{{Zero width space}}<!-- zero-width space; might be removable after introduction of RemexHTML --><span class="frac nowrap">{{#if:{{{3|}}} | |||
|{{{1}}}<templatestyles src="Screen reader-only/styles.css"/><span class="sr-only"> </span><sup>{{{2}}}</sup>⁄<sub>{{{3}}}</sub> | |{{{1}}}<templatestyles src="Screen reader-only/styles.css"/><span class="sr-only"> </span><sup>{{{2}}}</sup>⁄<sub>{{{3}}}</sub> | ||
|{{#if:{{{2|}}} | |{{#if:{{{2|}}} |
Revision as of 17:32, 21 March 2021
User:RMCD bot/subject notice Template:Zero width space⁄
Template:Documentation subpage Template:Uses TemplateStyles This template builds an alternative form of common fractions. The template takes one, two, or three parameters: the optional integer (may be signed), the optional numerator and the required denominator; in this order.
Please do not subst:
itute it.
{{fraction|A|B|C}}
- Template:Zero width spaceAPage Template:Screen reader-only/styles.css has no content. B⁄C (integer, numerator and denominator)
{{fraction|B|C}}
- Template:Zero width spaceB⁄C (numerator and denominator)
{{fraction|C}}
- Template:Zero width space1⁄C (denominator only)
{{fraction}}
- Template:Zero width space⁄ (fraction slash only)
Examples
- Numbers
- Template:Zero width space1⁄2 Template:Zero width space1⁄3 Template:Zero width space2⁄3 Template:Zero width space1⁄4 Template:Zero width space3⁄4 Template:Zero width space1⁄5 Template:Zero width space2⁄5 Template:Zero width space3⁄5 Template:Zero width space4⁄5 Template:Zero width space1⁄6 Template:Zero width space5⁄6 Template:Zero width space1⁄7 Template:Zero width space2⁄7 Template:Zero width space3⁄7 Template:Zero width space4⁄7 Template:Zero width space5⁄7 Template:Zero width space6⁄7 Template:Zero width space1⁄8 Template:Zero width space3⁄8 Template:Zero width space5⁄8 Template:Zero width space7⁄8 Template:Zero width space1⁄16 Template:Zero width space3⁄16 Template:Zero width space5⁄16 Template:Zero width space7⁄16 Template:Zero width space9⁄16 Template:Zero width space11⁄16 Template:Zero width space13⁄16 Template:Zero width space15⁄16
- Units
- Template:Zero width spacem⁄s Template:Zero width spacekm⁄h Template:Zero width spacekg·m⁄s2 Template:Zero width space1⁄s Template:Zero width spaceMbit⁄s
Notes
{{fraction}}
or⁄
may be used to print out the fraction slash glyph " ⁄ ".- For mixed fractions, in some contexts (like link targets) a "+" is generated between the whole number part and fraction part. If this is not desirable, put the whole number part outside the template, and put a non-breaking space between when the spacing is desirable. For example: "33 {{frac|1|3}}".
Parameters
A template for displaying common fractions of the form int+num/den nicely. It supports 0–3 anonymous parameters with positional meaning.
Parameter | Description | Type | Status | |
---|---|---|---|---|
leftmost part | 1 | Denominator if only parameter supplied. Numerator if 2 parameters supplied. Integer if 3 parameters supplied. If no parameter is specified the template will render a fraction slash only. | Line | optional |
middle-right part | 2 | Denominator if 2 parameters supplied. Numerator if 3 parameters supplied. | Line | optional |
rightmost part | 3 | Denominator, always. | Line | optional |
See also
- {{sfrac}} (Template:Sfrac) – displays common fractions using a vinculum (horizontal line), for scientific and mathematical text