Gotta Be Careful with parseFloat2013-09-19
Ran into this one today. Somebody forgot to remove the comma from a float:
parseFloat(1000); // 1000, ok parseFloat("1000"); // 1000, ok parseFloat("1,000"); // 1, very bad!!!
The code in question was trying to parse a dollar amount from a popup form field.
It trimmed the "$" (which would cause a NaN and be noticed immediately), but it failed to remove the ",", which caused truncation. Unfortunately, since values over $1,000 are rare (but important!), and the destination was a screen full of other numbers, and it was one screen in a huge application, it took months before somebody with sharp eyes caught the bug in action.