Template:Ifnumber
Jump to navigation
Jump to search
Checks if the first parameter results in a numeric value, for use in other templates. Copied from the French Wikisource wiki.
Examples:
{{ifnumber|3|yes|no}}
-> yes{{ifnumber|This is not a number|yes|no}}
-> no
The other parameters are optional:
{{ifnumber|3||no}}
->{{ifnumber|3|yes}}
-> yes{{ifnumber|This is not a number||no}}
-> no{{ifnumber|This is not a number|yes}}
->
Template Data
Returns the second parameter if the first parameter is numeric, and the third parameter if it's not.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Value to check | 1 | The value that is checked for whether or not it's numeric. | Line | required |
Output if numeric | 2 | The returned value if the first parameter is numeric. | Content | suggested |
Output if not numeric | 3 | The returned value if the first parameter is NOT numeric. | Content | suggested |