Function Reference


IsNumber

Checks if a variable's base type is numeric.

IsNumber ( variable )

Parameters

variable The variable/expression to check.

Return Value

Success: 1.
Failure: 0 if expression is not numeric type.

Remarks

A number can be an integer/whole number or a fractional/floating-point.

If the variable is a numeric value represented as a string, then IsNumber() will return 0.

See language datatypes for a detailed description.

Related

IsArray, IsBinary, IsBool, IsFloat, IsHWnd, IsInt, IsMap, IsPtr, IsString

Example

#include <MsgBoxConstants.au3>

Local $iLife = 42
If IsNumber($iLife) Then
        MsgBox($MB_SYSTEMMODAL, "", "The variable is a number")
Else
        MsgBox($MB_SYSTEMMODAL, "", "The variable is not a number")
EndIf