• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Fraction

  • Template
  • Talk
  • Language
  • Watch
  • View source

⁄

Template documentation[view] [edit] [history] [purge]
WarningThis template is used on approximately 40,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.
This template should not be substituted.
For science or mathematical articles, use {{sfrac}} instead. Per MOS:FRAC and MOS:MATH § Fractions.
CSSThis template uses TemplateStyles:
  • Template:Fraction/styles.css (sandbox)

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)

Contents

  • 1 Examples
  • 2 Notes
  • 3 Parameters
  • 4 See also

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

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Fraction in articles based on its TemplateData.

TemplateData for Fraction

For science or mathematical articles, use {{sfrac}} instead. Per [[MOS:FRAC]] and [[MOS:MATH#Fractions]]. A template for displaying common fractions of the form int+num/den nicely. It supports 0–3 anonymous parameters with positional meaning.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
leftmost part1

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.

Lineoptional
middle-right part2

Denominator if 2 parameters supplied. Numerator if 3 parameters supplied.

Lineoptional
rightmost part3

Denominator, always.

Lineoptional

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


  • v
  • t
  • e
Math templates
  • Functions
  • Numeral systems
Functions
  • elementary arithmetic
  • precision
  • val (value formatting)
  • percentage
Numeral systems
  • {{#invoke:BaseConvert|XtoY}}
  • binary
  • decimal2Base
  • hex2dec
  • hexadecimal
  • octal
  • quaternary
  • rn
  • roman
  • ternary
  • vigesimal
Conversions
convert many units (see: list)
cvt abbreviated {{convert}}
convinfobox {{convert}} for infoboxes
bbl to t barrels of oil to tonnes
long ton long hundredweights, quarters and pounds to kilograms;
long tons and hundredweights to pounds and metric tons
miles-chains miles and chains to kilometres linking "chains"
decdeg degrees, minutes, and seconds to decimal degrees
deg2dms decimal degrees to degrees, minutes, and seconds
deg2hms decimal degrees to hour angle (in hours, minutes, and seconds)
hms2deg hour angle (in hours, minutes, and seconds) to decimal degrees
inflation calculate inflation of Consumer Price Index-related prices
pop density population density in an area
track gauge railway track gauges
Notation and formatting
bigmath bigger font to match TeX \displaystyle (standalone formulas only) math short text-based formulas
mathcal [mathematical] calligraphic font; alternative to LaTeX \mathcal{...} tombstone symbol indicating the end of a proof
mvar individual italicized maths variables in normal text val measurement values, uncertainties and units
  • overline
  • underline
a line set above/below a sequence of characters vec various overarrows, underarrows, etc.
abs absolute values (paired vertical lines)
  • langle
  • rangle
  • angbr
  • angular brackets
  • bra-ket
  • braket
  • bra
  • ket
  • bra–ket notation
  • ldelim
  • rdelim
  • multiline delimiters (2–5 lines inclusive)
    ceil, floor calculations :mw:Help:#expr; formatting indicators ⌈3.14⌉, ⌊3.14⌋ (no calculation performed) pars parentheses that can be resized (∑)
    fraction slant fractions 3⁄5 (not for maths/science articles; use standing or upright fractions {{sfrac}} instead) sfrac "standing" or upright fractions ⁠3/5⁠ (use in maths/science articles instead of{{fraction}})
    intmath integral symbols
  • sub
  • sup
  • su
  • subscripts and superscripts
  • overset
  • underset
  • arbitrary characters/diacritics set above/below one another    
    tmath Wrap TeX in <math> tags
  • Boxes
  • Tags
  • Notices
  • BoxesTags
    • arithmetic operations
    • calculus
    • Infobox mathematical function
    • functions
    • metricate
    • undue precision
    • units attention
    • Category
    • Module:Math
    The above documentation is transcluded from Template:Fraction/doc. (edit | history)
    Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
    Add categories to the /doc subpage. Subpages of this template.
    Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Fraction&oldid=1195992771"
    Last edited on 16 January 2024, at 00:53

    Languages

      • Afrikaans
      • Alemannisch
      • العربية
      • অসমীয়া
      • Asturianu
      • Azərbaycanca
      • تۆرکجه
      • Basa Bali
      • বাংলা
      • Banjar
      • 閩南語 / Bân-lâm-gí
      • Башҡортса
      • Беларуская
      • Беларуская (тарашкевіца)
      • भोजपुरी
      • Български
      • Boarisch
      • Bosanski
      • Буряад
      • Català
      • Čeština
      • Corsu
      • Dansk
      • Deutsch
      • Eesti
      • Ελληνικά
      • Эрзянь
      • Español
      • Esperanto
      • Euskara
      • فارسی
      • Føroyskt
      • Français
      • Gaeilge
      • Gaelg
      • Galego
      • 贛語
      • 客家語 / Hak-kâ-ngî
      • 한국어
      • Հայերեն
      • हिन्दी
      • Ilokano
      • Bahasa Indonesia
      • Ирон
      • IsiZulu
      • Íslenska
      • Italiano
      • עברית
      • Jawa
      • ქართული
      • Қазақша
      • Kurdî
      • Latina
      • Latviešu
      • Lietuvių
      • मैथिली
      • Македонски
      • Malagasy
      • മലയാളം
      • Malti
      • मराठी
      • ဘာသာမန်
      • Bahasa Melayu
      • 閩東語 / Mìng-dĕ̤ng-ngṳ̄
      • မြန်မာဘာသာ
      • Na Vosa Vakaviti
      • Nederlands
      • नेपाली
      • नेपाल भाषा
      • 日本語
      • Нохчийн
      • Nordfriisk
      • Norsk bokmål
      • Norsk nynorsk
      • Occitan
      • ଓଡ଼ିଆ
      • Oʻzbekcha / ўзбекча
      • ਪੰਜਾਬੀ
      • ပအိုဝ်ႏဘာႏသာႏ
      • ភាសាខ្មែរ
      • Plattdüütsch
      • Português
      • Română
      • Runa Simi
      • Русский
      • Саха тыла
      • संस्कृतम्
      • Scots
      • Shqip
      • Sicilianu
      • Simple English
      • Slovenčina
      • Slovenščina
      • کوردی
      • Српски / srpski
      • Srpskohrvatski / српскохрватски
      • Sunda
      • Suomi
      • Svenska
      • தமிழ்
      • တႆး
      • తెలుగు
      • ไทย
      • Тоҷикӣ
      • Türkçe
      • Українська
      • اردو
      • Vèneto
      • Tiếng Việt
      • 吴语
      • 粵語
      • Zazaki
      • 中文
      • Kumoring
      • ꠍꠤꠟꠐꠤ
      Wikipedia
      • Wikimedia Foundation
      • Powered by MediaWiki
      • This page was last edited on 16 January 2024, at 00:53 (UTC).
      • Content is available under CC BY-SA 4.0 unless otherwise noted.
      • Privacy policy
      • About Wikipedia
      • Disclaimers
      • Contact Wikipedia
      • Code of Conduct
      • Developers
      • Statistics
      • Cookie statement
      • Terms of Use
      • Desktop