StringToReal(), S2R(), Value()

Summary

Converts a string to a real number.

Syntax

real_value = StringToReal(string input_string)

Argument Contents
input_string Any string

Returns

A real number equal to the value of input_string.

Notes

  • Returns zero if the string begins with a non-numeric character or is null.

  • Conversion stops at any non-numeric character (except a period).

  • Can also be called as S2R() and Value().

Example

rval1 = StringToReal("35.012") // rval1 = 35.012
rval2 = StringToReal("35FRED") // rval2 = 35
rval3 = S2R("Hello35") // rval3 = 0
rval4 = S2R(null) // rval4 = 0

See Also

Function Summary
Format() Formats a number
IntToString() Converts an integer to a string representation of the integer value
RealToInt() Converts a real number to an integer
RealToString() Converts a real number to a string
StringToInt() Converts a string to an integer value
Value() Converts a string to a real number