Niccaman Posted September 18, 2009 Share Posted September 18, 2009 I have a script which gets an elements innerhtml, which is "08". I run parseInt on it, and it returns "0". Any ideas? Link to comment https://forums.phpfreaks.com/topic/174688-solved-parseint-problem/ Share on other sites More sharing options...
MadTechie Posted September 18, 2009 Share Posted September 18, 2009 when using parseInt () If the string begins with "0", the radix is 8 (octal). try setting the radix to base 10 ie parseInt("08",10); Link to comment https://forums.phpfreaks.com/topic/174688-solved-parseint-problem/#findComment-920619 Share on other sites More sharing options...
Niccaman Posted September 18, 2009 Author Share Posted September 18, 2009 worked like a charm, tyvm Link to comment https://forums.phpfreaks.com/topic/174688-solved-parseint-problem/#findComment-920620 Share on other sites More sharing options...
MadTechie Posted September 18, 2009 Share Posted September 18, 2009 Welcome I think I had that problem a long time again.. Link to comment https://forums.phpfreaks.com/topic/174688-solved-parseint-problem/#findComment-920622 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.