The NUMVAL-C function returns the numeric value represented by the character string specified by argument-1. Any optional
currency string specified by argument-2 and any optional commas preceding the decimal point are ignored. The type of this
function is numeric.
General Format
Arguments
- Argument-1 must be an alphanumeric
or national
literal or an alphanumeric
or national
data item whose content has one of the following two formats:
or
where space is a string of zero or more spaces, cs is the string of one or more characters specified by argument-2 and digit
is a string of one or more digits.
- If the DECIMAL POINT IS COMMA clause is specified in the Special-Names paragraph, the functions of the comma and decimal point
in argument-1 are reversed.
- The total number of digits in argument-1 must not exceed 18.
- Argument-2, if specified, must be of the same class as argument-1.
It cannot be a digit, comma, space, plus sign(+), minus sign (-) or decimal point.
- If argument-2 is not specified, the character used for cs is the currency string specified for the program when argument-1
is of class alphanumeric
; or if argument-1 is of class national, the national representation of the currency string specified for the program. The
national representation of cs is the value returned from FUNCTION NATIONAL-OF (cs).
Returned Values
- The returned value is the numeric value represented by argument-1.
- The number of digits returned is 18.
- Floating-point format is used for numeric non-integer results.