Template:Party Size: Difference between revisions
mNo edit summary |
(prettify documentation, add error and remove stray br) |
||
Line 1: | Line 1: | ||
<includeonly>{{#ifexpr:{{{min}}}-{{{max}}}<0|{{{min}}}-{{{max}}}|{{{min}}}}} Player{{#switch: {{{max}}} | <includeonly>{{ | ||
|1 = | #ifexpr:{{{min}}} > {{{max}}} | Error: {{{min}}} must be smaller or equal to {{{max}}} | ||
|#default = s | | | ||
}}</includeonly> | {{ | ||
<noinclude>==Purpose== | #ifexpr:{{{min}}} - {{{max}}} < 0 | {{{min}}}-{{{max}}} | {{{min}}}}} Player{{#switch: {{{max}}} | ||
Party Size turns the | |1 = |#default = s | ||
}} | |||
}}</includeonly><noinclude>==Purpose== | |||
Party Size turns the the inclusive bookends of an integer range into a pretty string. Used for infoboxes and other templates. | |||
==Examples== | ==Examples== | ||
Party | ===Party Size Between 1 and 6=== | ||
<pre>{{Party Size|min=1|max=6}}</pre> | <pre>{{Party Size|min=1|max=6}}</pre> | ||
{{Party Size|min=1|max=6}} | {{Party Size|min=1|max=6}} | ||
Party | ===Party Size Between 1 and 1=== | ||
<pre>{{Party Size|min=1|max=1}}</pre> | <pre>{{Party Size|min=1|max=1}}</pre> | ||
{{Party Size|min=1|max=1}} | {{Party Size|min=1|max=1}} | ||
Party | ===Party Size Between 2 and 2=== | ||
<pre>{{Party Size|min=2|max=2}}</pre> | <pre>{{Party Size|min=2|max=2}}</pre> | ||
{{Party Size|min=2|max=2}} | {{Party Size|min=2|max=2}} | ||
===Party Size Between 6 and 1=== | |||
<pre>{{Party Size|min=6|max=1}}</pre> | |||
{{Party Size|min=6|max=1}} | |||
</noinclude> | </noinclude> |
Revision as of 01:22, 20 December 2023
Purpose
Party Size turns the the inclusive bookends of an integer range into a pretty string. Used for infoboxes and other templates.
Examples
Party Size Between 1 and 6
{{Party Size|min=1|max=6}}
1-6 Players
Party Size Between 1 and 1
{{Party Size|min=1|max=1}}
1 Player
Party Size Between 2 and 2
{{Party Size|min=2|max=2}}
2 Players
Party Size Between 6 and 1
{{Party Size|min=6|max=1}}
Error: 6 must be smaller or equal to 1