Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

parseInt octal issue

0 views
Skip to first unread message

PC Brand

unread,
Sep 17, 2009, 12:37:58 PM9/17/09
to
Hi..

I just wrote an answer but seems like i'm not that smart and that I
wrote it as response to author directly...

so here's only a quick solution (I hate writing same things 2
times).
The issue happens because of buggy parseInt().

Use: parseInt(someVar, 10), instead of just parseInt(someVar). That
way you specify the base for transformation to number and javascript
won't confuse the values like '08' or '09' for (non existing) octal 8
and octal 9.

Bye.

0 new messages