Template:IfNum

From Wikimedia Commons, the free media repository
Jump to: navigation, search


Dialog-warning-orange.svg Note: This template is used on a lot of pages. In order not to put too much load on the servers, edits should be kept to a bare minimum. Please discuss proposed changes on the talk page first.
  • Editing a template causes all pages that use the template to be re-rendered. If the template is used often, this can put a lot of load on the servers since it fills up the job queue.
  • Keep in mind that templates that are used on file description pages also show up on other wikis.
  • This page has been protected from editing to prevent vandalism. Only administrators can edit it. Get their attention by placing {{edit protected}} at the talk page.
Documentation icon Documentationviewedithistorypurge

This documentation is transcluded from Template:IfNum/doc.

Checks if the parameter has a numeric value.

Usage

{{IfNum |1= |2= |3= }}

Template parameters

Parameter Description Default Status
1 expression to test empty required
2 statement to show is true (parameter has a numeric value) empty optional
3 statement to show is false (parameter is text or empty). empty optional

Additional information

The template is intended to be used in the following namespaces: all namespaces

The template is intended to be used by the following user groups: all users

Relies on:
Module:String

Localization

This template is not intended to be localized.

Examples

{{IfNum | 1234| number| not a number}} = number
{{IfNum | 1.34| number| not a number}} = number
{{IfNum | 0123| number| not a number}} = number
{{IfNum | -1| number| not a number}} = number
{{IfNum | +010| number| not a number}} = number
{{IfNum | 0| number| not a number}} = number
{{IfNum | -0| number| not a number}} = number
{{IfNum | 0.00| number| not a number}} = number
{{IfNum | 2010-01-01| number| not a number}} = not a number
{{IfNum | 2010-01| number| not a number}} = not a number
{{IfNum | abcde| number| not a number}} = not a number
{{IfNum | | number| not a number}} = not a number