updateCalculationInput = (e) => {
let value;
value = numFormatter.format(e.target.value); // 123,456.78 - 3rd decimal rounds to nearest number as expected
if(value === 'NaN') return; // locale returns string of NaN if fail
value = value.replace(/,/g, ""); // remove commas
value = parseFloat(value); // now parse to float should always be clean input
// Do the actual math and setState calls here
}
To remove commas, you will need to use string replace method.
var numberArray = ["1000,00", "23", "11"];
//If String
var arrayValue = parseFloat(numberArray.toString().replace(/,/g, ""));
console.log(arrayValue, "Array into toString")
// If Array
var number = "23,949,333";
var stringValue = parseFloat(number.replace(/,/g, ""));
console.log(stringValue, "using String");