I have an example of data that has spaces between the numbers, however I want to return the whole number without the spaces:
mynumber = parseInt("120 000", 10);
console.log(mynumber); // 120
i want it to return 120000
. Could somebody help me with this?
thanks
update
the problem is I have declared my variable like this in the beginning of the code:
var mynumber = Number.MIN_SAFE_INTEGER;
apparently this is causing a problem with your solutions provided.
parseInt('120 000', 10)
? – Mudd