Template:num

Hello, you have come here looking for the meaning of the word Template:num. In DICTIOUS you will not only get to know all the dictionary meanings for the word Template:num, but we will also tell you about its etymology, its characteristics and you will know how to say Template:num in singular and plural. Everything you need to know about the word Template:num you have here. The definition of the word Template:num will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofTemplate:num, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

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

  • {{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!