β
Template documentation[view] [edit] [history] [purge]
| π Warning | This template is used on approximately 41,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
| π Image | This template should not be substituted. |
| π Image | For science or mathematical articles, use {{sfrac}} instead. Per MOS:FRAC and MOS:MATH Β§ Fractions. |
| π CSS | This template uses TemplateStyles: |
This template builds an alternative form of common fractions. The template takes zero, one, two, or three parameters: the optional integer (may be signed), the optional numerator and the required denominator; in this order.
Please do not substitute it. This template should also not be used in certain situations; see MOS:FRAC and MOS:MATH Β§ Fractions. For science or mathematical articles, use {{sfrac}} instead. To allow numerical sorting of a column containing fractions, use data-sort-value="X.YYY" where X.YYY is a rounded decimal equivalent. See Help:Sortable tables for more information and options. Inside citation templates, use the cleaner {{citefrac}}.
{{fraction|A|B|C}}- A+BβC (integer, numerator and denominator)
{{fraction|B|C}}- BβC (numerator and denominator)
{{fraction|C}}- 1βC (denominator only)
{{fraction}}- β (fraction slash only)
Examples
- Numbers
- 1β2, 1β3, 2β3, 1β4, 3β4, 1β5, 2β5, 3β5, 4β5, 1β6, 5β6, 1β7, 2β7, 3β7, 4β7, 5β7, 6β7, 1β8, 3β8, 5β8, 7β8, 1β16, 3β16, 5β16, 7β16, 9β16, 11β16, 13β16, 15β16
- Units
- mβs, kmβh, kgΒ·mβs2, 1βs, Mbitβ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
TemplateData for Fraction
| 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
- Wikipedia:Rendering math
- {{1/2}} (1β2), {{1/3}}, {{2/3}}, {{1/4}}, {{3/4}} β shorthands that use this template
- {{sfrac}} (β 1/2β ) β displays common fractions using a vinculum (horizontal line), for scientific and mathematical text
- {{su}} (superscript
subscript text) β to align both b=subscript & p=superscript - {{sub}} (subscript text) β to show a subscript
- {{sup}} (superscript text) β to show a superscript
- Help:Displaying a formula Β§ Fractions, matrices, multilines
- Help:Convert Β§ Fractions
- Number Forms, a Unicode block consisting primarily of vulgar fractions
- OpenType fonts feature frac, CSS
font-variant-numeric:diagonal-fractions - U+2215 β DIVISION SLASH
