Template:Simplified fraction/doc: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
Ganaram inukshuk (talk | contribs)
No edit summary
Ganaram inukshuk (talk | contribs)
No edit summary
 
Line 1: Line 1:
{{dochead}}{{lua}}
{{dochead}}
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).
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).



Latest revision as of 06:38, 31 October 2025

This template has a corresponding Lua module Module:Simplified fraction, but does not invoke its functions.
This template invokes the following functions: simfrac from Reduced fraction.

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 {{frac}} 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:

  • n: the numerator
  • d: the denominator
  • mixed: whether the fraction is mixed or not if it's more than 1

Examples

{{Simplified fraction|16|15|false}}

16⁄15


{{Simplified fraction|8|15|true}}

8⁄15


{{Simplified fraction|24|15|false}}

8⁄5


{{Simplified fraction|44|14|true}}

3 1⁄7


{{Simplified fraction|75|15|false}}

5


{{Simplified fraction|100|5|true}}

20