සැකිල්ල:num
පෙනුම
- පහත දැක්වෙන උපදෙස්, සැකිල්ල:num/documentation හි පිහිටා ඇත. සැකිල්ල:num/documentation]]. [සංස්කරණය]
- ප්රයෝජනවත් සබැඳි: උප පිටු ලැයිස්තුව • සබැඳි • යළි යොමු • transclusions • errors (parser/module) • sandbox
Usage
[සංස්කරණය]This template checks whether an input is a number. In a template, it can be used with the parser function {{#if:}} to provide different outputs depending on whether the input is a number, like this:
{{#if:{{num|INPUT}}
| OUTPUT IF THE INPUT IS A NUMBER
| OUTPUT IF THE INPUT IS NOT A NUMBER
}}
Parameters
[සංස්කරණය]|1=– the input to be checked. If the input is a number, it will return the number, otherwise it will return nothing.
Examples
[සංස්කරණය]Simple examples
[සංස්කරණය]Example using the {{#if:}} parser function
[සංස්කරණය]| Wikitext | Result |
|---|---|
{{#if:{{num|12,345}}
| This is a number!
| This is not a number!
}}
|
This is a number! |
{{#if:{{num|Hello, world!}}
| This is a number!
| This is not a number!
}}
|
This is not a number! |