Num Function

Determines whether a string is numeric. If NLS is enabled, the result of this function depends on the current locale setting of the Numeric convention.

Syntax

Num (expression)

expression is the expression to test. If expression is a number, a numeric string, or an empty string, a value of 1 is returned. If it is a null value, null is returned; otherwise 0 is returned.

Remarks

Strings that contain periods used as decimal points are considered numeric. But strings containing other characters used in formatting monetary or numeric amounts, for example, commas, dollar signs, and so on, are not considered numeric.

Examples

The following examples show the Num function being used to determine if a variable contains a number:

Arg1 = "123.45 
Boolean = Num(Arg1) ;* returns 1, that is, True
Arg2 = "Section 4" 
Boolean = Num(Arg2) ;* returns 0, that is, False
Arg3 = " " 
Boolean = Num(Arg3) ;* False (space is not numeric)
Arg4 = "" 
Boolean = Num(Arg4) ;* True (empty string is numeric)