Possible Duplicate:
Workarounds for JavaScript parseInt octal bug
How to parseInt a string with leading 0
document.write(parseInt("07"));
Produces “7”
document.write(parseInt("08"));
Produces “0”
This is producing problems for me (sorry for this babble, I have to or I can’t submit the question). Anyone know why it’s being stupid or if there is a better function?
If you argument begins with 0, it will be parsed as octal, and 08 is not a valid octal number. Provide a second argument
10which specifies the radix – a base 10 number.