Strange javascript error in parseInt Hello
Created May 8, 2012
Axel Richter
HI,
the function parseInt(string, radix) has a second parameter radix, see http://devedge-temp.mozilla.org/library/manuals/2000/javascript/1.3/reference/toplev.html#1064173.
If there is a leading zero in the string, the radix defaults to octal (8). In octal system there are only numerics from 0 to 7. So "08" is 0, "09" is 0 and "010" is 8 ;-).
Set the radix parameter to 10 if you like to have decimal numbers.
alert(parseInt(num, 10));
greetings
Axel