Template:Simplified fraction/doc: Difference between revisions

Tristanbay (talk | contribs)
added some documentation
Ganaram inukshuk (talk | contribs)
No edit summary
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{dochead}}{{lua}}{{clear}}
{{dochead}}
This template is for creating fractions that are automatically reduced to their simplest form. It is meant to come in handy for automated template modules that use Lua to generate fractional numbers in a loop.
This template is for creating fractions that are automatically made into their simplest form. It is recommended to use this template in tables instead of <syntaxhighlight inline>{{frac}}</syntaxhighlight> to prevent unwanted horizontal page scrolling on mobile (possibly due to a bug with how MediaWiki handles that specific style of fraction in one or more specific situations).


There are 3 parameters:
There are 3 parameters:
* n: the numerator
* n: the numerator
* d: the denominator
* d: the denominator
* mixed: whether the fraction is mixed or not if it's more than 1.
* mixed: whether the fraction is mixed or not if it's more than 1


=== Examples ===
<pre>{{Simplified fraction|16|15|false}}
</pre>
{{{{ROOTPAGENAME}}|16|15|false}}
<pre>{{Simplified fraction|8|15|true}}
</pre>
{{{{ROOTPAGENAME}}|8|15|true}}
<pre>{{Simplified fraction|24|15|false}}
</pre>
{{{{ROOTPAGENAME}}|24|15|false}}
{{{{ROOTPAGENAME}}|24|15|false}}


<pre>{{Simplified fraction|44|14|true}}
</pre>
{{{{ROOTPAGENAME}}|44|14|true}}
{{{{ROOTPAGENAME}}|44|14|true}}


<pre>{{Simplified fraction|75|15|false}}
</pre>
{{{{ROOTPAGENAME}}|75|15|false}}
{{{{ROOTPAGENAME}}|75|15|false}}


<pre>{{Simplified fraction|100|5|true}}
</pre>
{{{{ROOTPAGENAME}}|100|5|true}}
{{{{ROOTPAGENAME}}|100|5|true}}