Try parseInt()
parseInt(s)
parseInt(s, radix)
arguments:
s = The String to be passed.
radix = An optional integer argument that represents the radix (i.e., base) of the number to be passed.
For more information refer to "Javascript - The Definitive Guide" page 643 in the 3rd edition.