str_to_num (STRING*)

str_to_int (STRING*)

str_to_float (STRING*)

Returns a number converted from a string.

Parameters:

STRING* - STRING pointer to be read.

Returns:

Numerical value of the string as a var, long, or double value, or 0 if the string is non-numerical.

Speed:

Fast

Remarks:

Example:

STRING* s = "3.1415926";
...
var vpi = str_to_num(s); // vpi == 3.142
float fpi = str_to_float(s); // fpi == 3.1415926

See also:

str_for_num, str_setchr, str_getchr

► latest version online