string-to-number

string-to-number is a built-in function in `C source code'.

(string-to-number STRING &optional BASE)

Parse STRING as a decimal number and return the number.
Ignore leading spaces and tabs, and all trailing chars. Return 0 if
STRING cannot be parsed as an integer or floating point number.

If BASE, interpret STRING as a number in that base. If BASE isn't
present, base 10 is used. BASE must be between 2 and 16 (inclusive).
If the base used is not 10, STRING is always parsed as an integer.