I'm making a basic tax calculation app using Javascript. I want to put a number into an input, then have it display in the input with commas e.g input 100000 display 100,000. I need to then use this value for the calculations, so it has to be converted back to an integer.
I have the first part to convert, but I'm not sure the best way to convert back to actually use in the calculations.
let updateNumber = function (inputValue) {
let newValue = Intl.NumberFormat().format(this.value);
income.value = newValue;
};
income.addEventListener("change", updateNumber);
Hopefully, that makes sense. This is my first post.