Val Function

Language Items List

Definition:

Returns the numeric value of the supplied string.

Syntax:

Val(strexpr)


Syntax Description


strexpr Any string expression that can be interpreted as a numeric value.

Details:

The Val function is the opposite of the Str$ function, which translates a supplied numeric expression into a string.

The Val function translates from left to right and ends at the first non-numeric character it encounters or at the end of the string. Dollar signs ($) and commas (,) that are often considered part of a numeric value are not recognized as numeric by Val. Also, the first period encountered in a translation is accepted as a decimal point, but a second period is considered non-numeric and ends the translation.

See Also:

Str, Str$ Functions