Template:Difference: Difference between revisions
From Archaelund Wiki
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
<onlyinclude><includeonly>{{#ifexpr:{{{1|}}}>0|<span style="color:Lime;">+{{{1}}}</span>|{{#ifexpr:{{{1|}}}<0|<span style="color:Red;">−{{{1}}}</span>|{{{1}}}}}}}</includeonly></onlyinclude> | <onlyinclude><includeonly>{{#ifexpr:{{{1|}}}>0|<span style="color:Lime;">+{{{1}}}</span>|{{#ifexpr:{{{1|}}}<0|<span style="color:Red;">−-{{#expr:-{{{1}}}}}</span>|{{{1}}}}}}}</includeonly></onlyinclude> | ||
{{Documentation}} | {{Documentation}} | ||
[[Category:General Templates]] | [[Category:General Templates]] | ||
Revision as of 13:17, 19 March 2022
Description
This template formats any input number as a bonus/malus. Positive numbers are highlighted in green and receive a preceding plus sign, while negative numbers are highlighted in red. Zeros are ouputted in standard color without any sign.
Usage
{{Difference|<number>}}
Note that this template only supports numbers. Any non-numeric input will result in an error message.
View/Edit documentation page