Answered
why does parseInt("008") return 0
and parseInt("009") returns 0
when parseInt("006") (and below) returns the proper number?
(Or is it something obvious?)
Thanks
and parseInt("009") returns 0
when parseInt("006") (and below) returns the proper number?
(Or is it something obvious?)
Thanks
A prefix of 0 in parseInt makes it think it's an octal (base 8) number.
If you want to force it to "think decimal", do:
parseInt("008", 10);
Ariel
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.