< Template:IsNum
Revision as of 16:05, 24 October 2022 by Arcology Expert Program (talk | contribs)
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:
By default, simply writing {{IsNum|1,327}} (where 1,327 is an example number) will pass through the parameter if it's numeric and return blank if it's not. If the parameter {{{1}}} is given, as in {{IsNum|1,327|boolean=true}}, then the template will output true if numeric and false if not numeric.
Return
| 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|boolean=true}} | 1+1 |
{{IsNum|2b∨¬2b|boolean=true}} |
