You are here: Functions > VALUE()

VALUE()

VALUE() converts a character expression or field into a numeric equivalent.

Use VALUE() if you need to convert a character expression or field value to a numeric value for use in Analyzer commands. VALUE() is the opposite of STRING().

VALUE() returns the numeric equivalent of a character expression or field value with a specified number of decimal places. If the decimal adjustment results in a loss of decimal places, the result is rounded.

VALUE() offers an optional parameter to allow specification of an alternate character for the decimal for non-English language uses.

If a string such as “123” contains no decimals, Analyzer treats the number as an integer. So if you specify VALUE ("123", 2), Analyzer interprets “123” as 123.00 not 1.23.

VALUE() accepts numbers in any format. You can use any numeric formatting accepted by the print field type such as punctuation, leading or trailing negative signs and parentheses as input.

Function Format

VALUE(C,# <,alternate_decimal_character>)

C is a character string
# is a numeric constant that cannot change from record to record.
Alternate decimal character is an optional parameter to specify the decimal character for Non-English languages.

Examples

VALUE("123.4-",3) = -123.400

VALUE("$123,456",2) = 123456.00

VALUE("77.45CR",2) = -77.45

VALUE("(123,456.78)",0) = -123457

VALUE("123.4-",2,",") = -123,40