I have a calculator. How do I add commas to an input, so when I type 40000 it would automatically display 40,000? (The number should still stay as 40000 in order to do the right calculation.)
This is how I get the value of the inputs:
handleStateChange = (e) => {
const { target: { name, value } } = e
this.setState({ [name]: value })
}