Hi fellow wiki editors!

To help newly registered users get more familiar with the wiki (and maybe older users too) there is now a {{Welcome to the wiki}} template. Have a look at it and feel free to add it to new users discussion pages (and perhaps your own).

I have tried to keep the template short, but meaningful. /Johan G

Template:IsNum

From FlightGear wiki
Jump to: navigation, search

0


The following template description is not displayed when the template is inserted in an article.

Goal

This template can be used when you want to see if a string is a number.

Usage

Renders as "1" if a string is a number and "0" when not.

{{IsNum|string}}
string
String with possible number. Numbers can have a trailing decimal point. Decimal numbers must use decimal point.

Examples

An empty sting is not a number: {{IsNum|}}

An empty sting is not a number: 0


Three is a number: {{IsNum|3}}

Three is a number: 1

Trailing decimal point can be used: {{IsNum|3.}}

Trailing decimal point can be used: 1


Decimal comma can not be used: {{IsNum|3,1}}

Decimal comma can not be used: 0


Decimal numbers can of course be used: {{IsNum|3.14}}

Decimal numbers can of course be used: 1