Template:Ifnumber/doc

From 118Wiki
< Template:Ifnumber
Revision as of 21:01, 29 June 2023 by Noa T'Nessa Levinson (talk | contribs) (Creating documentation subpage)
(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}} ->

Template Data

Returns the second parameter if the first parameter is numeric, and the third parameter if it's not.

Template parameters

ParameterDescriptionTypeStatus
Value to check1

The value that is checked for whether or not it's numeric.

Linerequired
Output if numeric2

The returned value if the first parameter is numeric.

Contentsuggested
Output if not numeric3

The returned value if the first parameter is NOT numeric.

Contentsuggested