e.g, if you try to parseInt (111,222) you ll get the value as 111. To solve this issue we have to use regex and reformat the value.
var numberWithComma = "111,222"; var res = parseFloat( numberWithComma.replace(/,/g, '')); console.log(res); //111222
e.g, if you try to parseInt (111,222) you ll get the value as 111. To solve this issue we have to use regex and reformat the value.
var numberWithComma = "111,222"; var res = parseFloat( numberWithComma.replace(/,/g, '')); console.log(res); //111222