NUM function

Syntax

NUM (expression)

Description

Use the NUM function to determine whether expression is a numeric or nonnumeric string. If expression is a number, a numeric string, or an empty string, it evaluates to true and a value of 1 is returned. If expression is a nonnumeric string, it evaluates to false and a value of 0 is returned.

A string that contains a period used as a decimal point ( . ) evaluates to numeric. A string that contains any other character used in formatting numeric or monetary amounts, for example, a comma ( , ) or a dollar sign ( $ ) evaluates to nonnumeric.

If expression evaluates to the null value, null is returned.

If NLS is enabled, NUM uses the Numeric category of the current locale to determine the decimal separator.

Example

X=NUM(2400)
Y=NUM("Section 4")
PRINT "X= ",X,"Y= ",Y

This is the program output:

X=    1     Y=    0