(Created page with "{{Documentation}} <includeonly><onlyinclude>{{#iferror:{{#expr:{{formatnum:{{{1|error}}}|R}}*0}}|{{#ifeq:{{{boolean|false}}}|true|0|}}|{{#ifeq:{{{boolean|false}}}|true|1|{{{1}}}}}}} </onlyinclude></includeonly>") |
No edit summary |
||
| Line 1: | Line 1: | ||
{{Documentation}} | {{Documentation}} | ||
<includeonly><onlyinclude>{{#iferror:{{#expr:{{formatnum:{{{1|error}}}|R}}*0}}|{{#ifeq:{{{boolean|false}}}|true| | <includeonly><onlyinclude>{{#iferror:{{#expr:{{formatnum:{{{1|error}}}|R}}*0}}|{{#ifeq:{{{boolean|false}}}|true|false|}}|{{#ifeq:{{{boolean|false}}}|true|true|{{{1}}}}}}} | ||
</onlyinclude></includeonly> | </onlyinclude></includeonly> | ||
Revision as of 16:03, 24 October 2022
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:
1is 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 outputtrueif numeric andfalseif 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|bool=true}} | 1+1 |
{{IsNum|2b∨¬2b|bool=true}} |
The documentation above was transcluded from Template:IsNum/Documentation. [edit]
