Tag: bugs
Javascript ParseInt Vs. ParseFloat
by z3n on May.01, 2010, under Coding, Tips & Hints
Problem:
While debbuging an javascript application i found out a wrong calculation result.
Solution:
Apparently javascript been developed my microsoft, due the extensive issues with many misbehaviors it’s quite sad to find out that there’s no way to escape from them.
var test="08"; alert(parseInt(test)+1); // will return 1 alert(parseFloat(test)+1); // will return 9, as supposed to