Jump to content

සැකිල්ල:num/documentation

Wiktionary වෙතින්
Documentation for සැකිල්ල:num. [edit]
This page contains usage information, categories, interwiki links and other content describing the template.

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
}}
  • |1= – the input to be checked. If the input is a number, it will return the number, otherwise it will return nothing.

Simple examples

[සංස්කරණය]
  • {{num|1234567890}} → 1234567890
  • {{num|1,000}} → 1000
  • {{num|foo}}

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!


"https://si.wiktionary.org/w/index.php?title=සැකිල්ල:num/documentation&oldid=190689" වෙතින් සම්ප්‍රවේශනය කෙරිණි