Difference between revisions of "Template:Sfrac"
Jump to navigation
Jump to search
m |
(Removing double space when no scalar) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | <span class="sfrac nowrap"{{#if:{{{3|}}}|>{{{1}}}<span class="visualhide"> </span><span}} <!-- | + | <includeonly><span class="sfrac nowrap"{{#if:{{{3|}}}|>{{{1}}}<span class="visualhide">{{#if:{{{1|}}}| }}</span><span}} <!-- |
-->style="display:inline-block; vertical-align:-0.5em; font-size:85%; text-align:center;"><!-- | -->style="display:inline-block; vertical-align:-0.5em; font-size:85%; text-align:center;"><!-- | ||
--><span style="display:block; line-height:1em; padding:0 0.1em;">{{#if:{{{3|}}}|{{{2}}}|{{#if:{{{2|}}}|{{{1}}}|1}}}}</span><!-- | --><span style="display:block; line-height:1em; padding:0 0.1em;">{{#if:{{{3|}}}|{{{2}}}|{{#if:{{{2|}}}|{{{1}}}|1}}}}</span><!-- | ||
− | + | --><span style="display:block; line-height:1.2em; padding:0 0.1em; border-top:1px solid;">{{{3|{{{2|{{{1}}}}}}}}}</span><!-- | |
− | --><span style="display:block; line-height: | ||
-->{{#if:{{{3|}}}|</span>}}<!-- | -->{{#if:{{{3|}}}|</span>}}<!-- | ||
− | --></span> | + | --></span></includeonly><noinclude>{{Documentation}}</noinclude> |
Latest revision as of 23:00, 2 May 2023
Formats a fraction
- First parameter is the scalar
- Second paramater is the numerator
- Third parameter is the denominator
{{Sfrac|1|2|3}}
results in: 1 23
This is text before {{Sfrac|421g|abc345|8989}} this is text after
results in: This is text before 421g abc3458989 this is text after
Before {{Sfrac||2|3}} after
results in: Before 23 after
Before {{Sfrac||{{Cross}}{{RimworldIcon}}|{{Check}}{{RoyaltyIcon}}}} after
The above documentation is transcluded from Template:Sfrac/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |