javascript - parseInt('08') - (or with '09') returns 0
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
firefox-3.0 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: firefox-3.0
I am displaying two days in two digit using printf of php. Now when this value is passed to javascript, i get 0 in following cirumstances - only for these two nos. I am using firefox 3.0.3
parseInt('08') and parseInt(''09')
I then tested in Error Console of FF and confirmed that i get 0 in these two nos.
My linux is Ubuntu 7.10 and 8.04 on Acer laptop and Dell vostro systems
i tested from 0 till 15.
i amusing PHP 5.2.4-2ubuntu5.3 with Suhosin-Patch 0.9.6.2 (cli) (built: Jul 23 2008 06:44:49) and FireFox 3.0.3
=======
Tnanks in advance for the solution
ProblemType: Bug
Architecture: i386
Date: Thu Oct 30 15:30:32 2008
DistroRelease: Ubuntu 8.04
Package: firefox-3.0 3.0.3+build1+
PackageArchitec
ProcEnviron:
PATH=/
LANG=en_IN.UTF-8
SHELL=/bin/bash
SourcePackage: firefox-3.0
Uname: Linux 2.6.24-21-server i686
strings that star with a leading "0" are considered octal encoded so this is a feature. just dont put the 0 in front.