Template:Ifnumber

From 118Wiki
Revision as of 16:07, 4 July 2021 by Noa T'Nessa Levinson (talk | contribs) (Creation of number checking template)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Checks if the first parameter results in a numeric value, for use in other templates. Copied from the French Wikisource wiki.

Examples:

  • {{ifnumber|3|yes|no}} -> yes
  • {{ifnumber|This is not a number|yes|no}} -> no

The other parameters are optional:

  • {{ifnumber|3||no}} ->
  • {{ifnumber|3|yes}} -> yes
  • {{ifnumber|This is not a number||no}} -> no
  • {{ifnumber|This is not a number|yes}} ->