Template:Sortable ratio: Difference between revisions
Jump to navigation
Jump to search
(Created page with "<includeonly><!--##### ## Sort key #########--><small style="display:none;">{{#switch:{{ratio|{{{1}}}|{{{2}}}|total={{{total|}}}|text=}} |0 = 0.000 |100 = 1.000 | {{#e...") |
mNo edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 8: | Line 8: | ||
######### | ######### | ||
## ratio template | ## ratio template | ||
#########-->{{#ifeq:{{{text|UNDEFINED}}}|UNDEFINED|{{ratio|{{{1}}}|{{{2}}}|total={{{total|}}}}}|{{ratio|{{{1}}}|{{{2}}}|total={{{total|}}}|text={{{text}}}}}}}</includeonly><noinclude> | #########-->{{#ifeq:{{{text|UNDEFINED}}}|UNDEFINED|{{ratio|{{{1}}}|{{{2}}}|total={{{total|}}}}}|{{ratio|{{{1}}}|{{{2}}}|total={{{total|}}}|text={{{text}}}}}}}</includeonly><noinclude>[[Category:Templates]] | ||
==Usage== | ==Usage== | ||
Usage and output is identical to {{[[template:ratio|ratio]]}}, except this template prepends a hidden decimal number that makes ratios sort correctly in | Usage and output is identical to {{[[template:ratio|ratio]]}}, except this template prepends a hidden decimal number that makes ratios sort correctly in sortable tables. | ||
==Usage== | |||
{| class="prettytable" | |||
| <pre>{{sortable ratio|1|2}}</pre> | |||
|style="font-size:2em;"| → | |||
| {{sortable ratio|1|2}} | |||
|- | |||
| <pre>{{sortable ratio|1|2|text=!!!!!}}</pre> | |||
|style="font-size:2em;"| → | |||
| {{sortable ratio|1|2|text=!!!!!}} | |||
|- | |||
| <pre>{{sortable ratio|1|total=3}}</pre> | |||
|style="font-size:2em;"| → | |||
| {{sortable ratio|1|total=3}} | |||
|- | |||
| <pre>{{sortable ratio|1|2|round=4}}</pre> | |||
|style="font-size:2em;"| → | |||
| {{sortable ratio|1|2|round=4}} | |||
|} | |||
</noinclude> |
Latest revision as of 05:03, 30 January 2014
Usage[edit source]
Usage and output is identical to {{ratio}}, except this template prepends a hidden decimal number that makes ratios sort correctly in sortable tables.
Usage[edit source]
{{sortable ratio|1|2}} |
→ | 0.333, 33.3% (1/3) |
{{sortable ratio|1|2|text=!!!!!}} |
→ | 0.333, 33.3!!!!! |
{{sortable ratio|1|total=3}} |
→ | 0.333, 33.3% (1/3) |
{{sortable ratio|1|2|round=4}} |
→ | 0.333, 33.3% (1/3) |