{{{1}}}
Purpose[]
Insert an inline colored quantity, by default green if quantity is evaluated as non-negative number, red if negative and teal if quantity can not be evaluated as a number (text).
Textual prefixes and suffixes can also be included as additional parameters, and will be colored according to quantity. This is useful for coloring percentages.
Colors for positive, negative and text can also be chosen via parameters.
Usage[]
{{qty | quantity | reverse colors, optional. If non-blank, reverse positive and negative colors | prefix text, optional | suffix text, optional | positive color, defaults to 'green' | negative color, defaults to 'red' | non-numeric (text) color, defaults to 'teal' }}
Examples[]
Basic usage: {{qty|+2}}, {{qty|-1}}, {{qty|0}}
→ Basic usage: +2, -1, 0
Arithmetic works:{{qty|10-20}}, {{qty|-10+20}}, {{qty|10*-2}}, {{qty|-10^2}}
→ Arithmetic works: 10-20, -10+20, 10*-2, -10^2
Reversing colors: {{qty|+10|*}}, {{qty|-10|*}}
→ Reversing colors: +10, -10
Prefixes and suffixes: {{qty|+10||raise of }}, {{qty|-10|||% discount}}
→ Prefixes and suffixes: raise of +10, -10% discount
Custom colors: {{qty|+10||||blue|yellow}}, {{qty|+10|*|||blue|yellow}}
→ Custom colors: +10, +10
Non-numeric values: {{qty|hello}}, {{qty|hello||||||purple}}, {{qty|hello||||||none}}
→ Non-numeric values: hello, hello, hello
See Template:Link qty for usages like this:
[[File: SS Fuel.png |23px]] {{qty|+10}} x Fuel<br> [[File: SS skullsmall.png|23px]] {{qty|+10|-}} x Terror