Difference between revisions of "Template:Int/doc"
From CannaQAWiki
Jump to navigationJump to searchShawndouglas (talk | contribs) m (1 revision imported: Attempting import of LIMSwiki templates Infobox–Latest news) |
Shawndouglas (talk | contribs) (Cleaned up initial import) |
||
(One intermediate revision by the same user not shown) | |||
Line 51: | Line 51: | ||
<includeonly> | <includeonly> | ||
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS --> | <!-- CATEGORIES AND INTERWIKIS HERE, THANKS --> | ||
[[Category: | [[Category:CannaQAwiki formatting and function templates]] | ||
</includeonly> | </includeonly> |
Latest revision as of 18:38, 16 March 2019
This is a documentation subpage for Template:Int. It contains usage information, categories, interlanguage links, and other content that is not part of the original template page. |
Usage
This template is used to determine if an argument is a number or not. If it is a number, then ‘1’ or, if provided, the second parameter is returned. Otherwise, ‘0’ or the third parameter is returned.
Parameter | Description | Type | Status | |
---|---|---|---|---|
test value | 1 | the argument to be tested | String | required |
true return value | 2 | what to display if the first argument is a number
| String | optional |
false return value | 3 | what to display if the first argument is not a number
| String | optional |
Examples
code | result |
---|---|
{{Int|a}} |
0 |
{{Int|1}} |
1 |
{{Int|1.0}} |
1 |
{{Int|1.1}} |
1 |
{{Int|1|a number|not a number}} |
a number |
{{Int|1.0|a number|not a number}} |
a number |
{{Int|1.1|a number|not a number}} |
a number |
{{Int|1/2|a number|not a number}} |
a number |
{{Int|1/1|a number|not a number}} |
a number |
{{Int|1e3|a number|not a number}} |
a number |
{{Int|1e-3|a number|not a number}} |
a number |
{{Int|0.1e3|a number|not a number}} |
a number |
See also
- {{isnumeric}}