Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Template:Fraction

Permanently protected template
From Wikipedia, the free encyclopedia
(Redirected fromTemplate:Frac)

Template documentation[view] [edit] [history] [purge]
WarningThis template is used onapproximately 40,000 pages and changes may be widely noticed. Test changes in the template's/sandbox or/testcases subpages, or in your ownuser subpage. Consider discussing changes on thetalk page before implementing them.
This template shouldnot besubstituted.
For science or mathematical articles, use{{sfrac}} instead. PerMOS:FRAC andMOS:MATH § Fractions.
CSSThis template usesTemplateStyles:

This template builds an alternative form ofcommon 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 notsubstitute it. This template should alsonot be used in certain situations; seeMOS:FRAC andMOS:MATH § Fractions. For science or mathematical articles, use{{sfrac}} instead. To allow numerical sorting of a column containing fractions, usedata-sort-value="X.YYY" whereX.YYY is a rounded decimal equivalent. SeeHelp:Sortable tables for more information and options. Inside citation templates, use the cleaner{{citefrac}}.

{{fraction|A|B|C}}
A+BC (integer, numerator and denominator)
{{fraction|B|C}}
BC (numerator and denominator)
{{fraction|C}}
1C (denominator only)
{{fraction}}
(fraction slash only)

Examples

Numbers
12,13,23,14,34,15,25,35,45,16,56,17,27,37,47,57,67,18,38,58,78,116,316,516,716,916,1116,1316,1516
Units
ms,kmh,kg·ms2,1s,Mbits

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 anon-breaking space between when the spacing is desirable. For example: "33 {{frac|1|3}}".

Parameters

This is theTemplateData for this template used byTemplateWizard,VisualEditor and other tools.See a monthly parameter usage report forTemplate: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


Math templates
  • Functions
  • Numeral systems
Functions
Numeral systems
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 todecimal degrees
deg2dms decimal degrees to degrees, minutes, and seconds
deg2hms decimal degrees tohour angle (in hours, minutes, and seconds)
hms2deghour 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 andformatting
bigmath bigger font to matchTeX\displaystyle (standalone formulas only)math short text-based formulas
mathcal [mathematical] calligraphic font; alternative toLaTeX\mathcal{...}tombstone symbol indicating theend of a proof
mvar individual italicized maths variables in normal textval measurement values, uncertainties and units
a line set above/below a sequence of charactersvec 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 indicators3.14,3.14 (no calculation performed)pars parentheses that can be resized()
    fraction slant fractions35 (not for maths/science articles; usestanding or upright fractions{{sfrac}} instead)sfrac "standing" or upright fractions3/5 (use in maths/science articles instead of{{fraction}})
    intmathintegral symbols
  • sub
  • sup
  • su
  • subscripts and superscripts
  • overset
  • underset
  • arbitrary characters/diacritics set above/below one another    
    tmath WrapTeX in<math> tags
  • Boxes
  • Tags
  • Notices
  • The abovedocumentation istranscluded fromTemplate:Fraction/doc.(edit |history)
    Editors can experiment in this template'ssandbox(edit |diff) andtestcases(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"
    Category:
    Hidden categories:

    [8]ページ先頭

    ©2009-2025 Movatter.jp