@IsNumber (JavaScript)

Indicates if a value is a number.

Defined in

@Functions (JavaScript)

Syntax

@IsNumber(value:any) : boolean
Parameter Description
value Value to be checked which can be scalar or an array.
Return value Description
boolean 1 if the value is a number; otherwise 0.

Examples

This example checks various values to see if they are numbers, text, or dates.
function p(stuff) {
	print("<<<" + stuff + ">>>");
}

function printType(value) {
	p(value + " is typeof " + typeof(value));
	if(@IsNumber(value)) p(value + " is number");
		else p(value + " is not number");
	if(@IsText(value)) p(value + " is text");
		else p(value + " is not text");
	if(@IsTime(value)) p(value + " is time");
		else p(value + " is not time");
}

printType("some text");
printType(9.8);
printType(new Number(9.9));
printType("4/1/06 12:01");
printType(new Date(2006, 3, 1, 12, 1));