I have a page with some elements that are controlled by the user. One of these is a text input field, where the user is supposed to input a number. Everything works well if
Use a global regular expression to replace all commas with an empty string:
var str = "12,345,678"; str = str.replace(/,/g, ""); parseInt(str, 10);