1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE>STR2NUM Convert a String to a Number
</TITLE>
</HEAD>
<BODY>
<H2>STR2NUM Convert a String to a Number
</H2>
<P>
Section: <A HREF=sec_io.html> Input/Ouput Functions </A>
<H3>Usage</H3>
Converts a string to a number. The general syntax for its use
is
<PRE>
x = str2num(string)
</PRE>
<P>
Here <code>string</code> is the data string, which contains the data to
be converted into a number. The output is in double precision,
and must be typecasted to the appropriate type based on what
you need. Note that by definition, <code>str2num</code> is entirely
equivalent to <code>eval(['[' string ']'],[])</code> with all of the
associated problems where <code>string</code> contains text that causes
side effects.
</BODY>
</HTML>
|