Template:IfNumber/doc

From Melvor Idle
< Template:IfNumber
Revision as of 23:11, 25 April 2024 by Auron956 (talk | contribs) (Document template)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Tests if the value of the first parameter is a number or not. If the parameter is a number, then the second parameter is returned (default: 1), otherwise the third parameter is returned (default: 0)

Examples

Code Result
{{IfNumber|7}} 1
{{IfNumber|seven}} 0
{{IfNumber|e}} 0
{{IfNumber|seven|Is a number|Is not a number}} Is not a number
{{IfNumber|7|Is a number|Is not a number}} Is a number