Template:Frac/doc: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Edokter
→‎See also: +sup, -subsup
meta>Zyxw
add {{TemplateData header}} before <templatedata>
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}
<!--PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE-->
<!-- Place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
 
This template builds an alternative form of [[common fraction]]s. The template takes one, two, or three parameters: the optional integer (may be signed), the optional numerator and the required denominator; in this order.  
This template builds an alternative form of [[common fraction]]s. The template takes one, two, or three parameters: the optional integer (may be signed), the optional numerator and the required denominator; in this order.  


Line 17: Line 18:


== Parameters ==
== Parameters ==
{{TemplateData header}}
<templatedata>{
<templatedata>{
"description": "A template for displaying common fractions of the form int+num/den nicely. It supports 0–3 anonymous parameters with positional meaning.",
"description": "A template for displaying common fractions of the form int+num/den nicely. It supports 0–3 anonymous parameters with positional meaning.",
Line 50: Line 52:
{{Math templates|notation}}
{{Math templates|notation}}


<includeonly>
<includeonly>{{#ifeq:{{PAGENAME}}|Frac|
{{#ifeq:{{PAGENAME}}|Frac|
<!-- Categories below this line, please; interwikis at Wikidata -->
<!--CATEGORIES HERE, THANKS-->
[[Category:Wikipedia formatting and function templates]]
[[Category:Wikipedia formatting and function templates]]
[[Category:Mathematical formatting templates]]
[[Category:Mathematical formatting templates]]
}}</includeonly>
}}</includeonly>

Revision as of 09:25, 26 August 2015

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. This template should not be used in science or mathematical articles, per MOS:FRAC and MOS:MATH#Fractions; use {{sfrac}} instead. To allow numerical sorting of a column containing fractions, use {{sortfrac}} instead. It is a combination of this template and {{sort}}.

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

Examples

Numbers
121323143415253545165617273747576718385878116316516716916111613161516
Units
mskmhkg·m1sMbits

Notes

  • {{frac}} or &frasl; may be used to print out the fraction slash glyph " ⁄ ".

Parameters

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

TemplateData for Frac

A template for displaying common fractions of the form int+num/den nicely. It supports 0–3 anonymous parameters with positional meaning.

Template parameters

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