Mr. Johnson (talk | contribs) (Created page with "<includeonly>Category:Helper Template</includeonly> {{Template|IsNum}} template tests whether a value is numeric (or at least, that it can be treated as such by the expression ParserFunction). ==Usage== It has one {{Parameter|mandatory|string}} and one {{Parameter|optional|named}}: * {{Code|1}} is the parameter to be tested; the template will pass through the parameter if it's numeric and return blank if it's not. * {{Code|bool}} (default {{code|false}} — if s...") |
(No difference)
|
Latest revision as of 21:43, 19 November 2023
Template:IsNum
template tests whether a value is numeric (or at least, that it can be treated as such by the expression ParserFunction).
Usage
It has one mandatory string parameter and one optional named parameter:
1
is the parameter to be tested; the template will pass through the parameter if it's numeric and return blank if it's not.bool
(defaultfalse
— if set totrue
, the template will outputtrue
if numeric andfalse
if not numeric.
Return
Error!
caption
is required by Template:Template:TableTop
!Code | Return |
---|---|
{{IsNum|1,327.50}} | 1,327.50 |
{{IsNum|9,999 (1950)}} | |
{{IsNum|9999999999999}} | 9999999999999 |
{{IsNum|500 metres}} | |
{{IsNum|500*500}} | 500*500 |
{{IsNum|9.999e50}} | 9.999e50 |
{{IsNum|1+1|bool=true}} | true |
{{IsNum|2b∨¬2b|bool=true}} | false |