Closed
Bug 372667
Opened 18 years ago
Closed 18 years ago
javascript parseInt() fails to return the correct integer for some strings
Categories
(Firefox :: General, defect)
Tracking
()
People
(Reporter: fahrenheit, Unassigned)
Details
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.9) Gecko/20061206 Firefox/1.5.0.9
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.9) Gecko/20061206 Firefox/1.5.0.9
parseInt() functions fails to correctly convert some strings, examples:
javascript: alert(parseInt('07')); -> 7
javascript: alert(parseInt('06')); -> 6
javascript: alert(parseInt('08')); -> 0
javascript: alert(parseInt('09')); -> 0
I know it's possible to use Number() and that works, but why does parseInt fail on this cases?
Reproducible: Always
Steps to Reproduce:
1. type javascript: alert(parseInt('08')); on the browser location bar or inside a js file
2. run the script
Expected Results:
8
Reporter | ||
Updated•18 years ago
|
Version: unspecified → 1.5.0.x Branch
Updated•18 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•