NUMVAL Function

The NUMVAL function returns the numeric value represented by the character string specified by argument-1. Leading and trailing spaces are ignored. The type of this function is numeric.

Usage

FUNCTION NUMVAL (argument-1)

Parameters

argument-1 Must be a non-numeric literal or alphanumeric data item whose content has one of the following two formats:
[space] [+] [space] {digit [ . [digit]]} [space]
        [-]         {. digit           }

or:

[space] {digit [ . [digit]]} [space] [+ ] [space]
        {. digit           }         [- ]
                                     [CR]
                                     [DB]

where space is a string of zero or more spaces, and digit is a string of one to 18 digits.

The total number of digits in argument-1 must not exceed 18. If your program has been compiled for 31-digit support ("-Dd31"), argument-1 must not exceed 31.

If the DECIMAL-POINT IS COMMA clause is specified in the SPECIAL-NAMES paragraph, a comma must be used in argument-1 rather than a decimal point.

Returned Values

  1. The returned value is the numeric value represented by argument-1.
  2. NUMVAL returns a 64-bit floating point value (normally 16 digits) and a 128-bit floating point value when compiled for 31-digit support ("-Dd31").