The NUMVAL-C function returns the numeric value represented by the alphanumeric character string specified as argument-1. Any optional currency sign specified by argument-2 and any optional commas preceding the decimal point are stripped away, producing a numeric value that can be used in an arithmetic expression.
The function type is numeric.
>>-+-------+--+----+--+-------+--+----+--+-------+--------------> '-space-' +-+--+ '-space-' '-cs-' '-space-' '- --' >--+-digit--+--------------+--+--------------+-+--+-------+---->< | | .----------. | '-.--+-------+-' | '-space-' | | V | | '-digit-' | | '---,--digit-+-' | '-.--digit----------------------------------'
>>-+-------+--+----+--+-------+---------------------------------> '-space-' '-cs-' '-space-' >--+-digit--+--------------+--+--------------+-+--+-------+-----> | | .----------. | '-.--+-------+-' | '-space-' | | V | | '-digit-' | | '---,--digit-+-' | '-.--digit----------------------------------' >--+----+--+-------+------------------------------------------->< +-+--+ '-space-' +- --+ +-CR-+ '-DB-'
If argument-2 is not specified, the character used for cs is the currency symbol specified for the program.
The returned value is a floating-point approximation of the numeric value represented by argument-1. See "Conversions and Precision" in the IBM Rational Development Studio for i: ILE COBOL Programmer's Guide for more information.