VAL()

Advantage Concepts

Advantage Expression Engine function that converts a character number to numeric type

Syntax

VAL(<cNumber>) à nNumber

Parameters

<cNumber> The character expression to be converted.

Return Values

VAL() returns <cNumber> converted to a numeric value including decimal digits.

Remarks

VAL() is a character conversion function that converts a character string containing numeric digits to a numeric value. When VAL() is executed, it evaluates <cNumber> until a second decimal point, the first non-numeric character, or the end of the expression is encountered. Leading spaces are ignored. As with all other functions that round, digits between zero and four are rounded down, and digits between five and nine are rounded up.

VAL() is the opposite of STR() and TRANSFORM(), which convert numeric values to character strings.

Note Advantage Expression Engine functions can be used in expressions such as record filter expressions and index expressions. They are not necessarily scalars supported within SQL statements. For a list of supported SQL scalar functions, see Supported Scalar Functions.

Note Memo, binary, and image fields are not supported in this Advantage Expression Engine function. If memo, binary, or image fields are used with this expression engine function, the Advantage Expression Engine will be unable to evaluate the expression.

See Also

ROUND()

STR()

TRANSFORM()

Advantage TDataSet Descendant

TAdsSetting.NumDecimals

Advantage Client Engine API

AdsSetDecimals