I am implementing input validation to disallow more than two decimals, but when I try and update a value, React is considering it to be the same so it won't update the state.
For example, the value is 1.00000, this will not work with my validation because JavaScript considers 1.0000 to be equal to 1, or 1.0 or 1.00, so when I call to update the state from 1.0000 to 1.00, nothing will happen. I don't blame React for this per se because it's probably doing JavaScript equality checks and seeing it's the same thing thus not updating the DOM.
Is there anyway I can force update the value from 1.000 to 1.00 via setting the state of a value using a functional component? Thanks
Validation not working, a user can add all these trailing 0s
Validation working properly, I can't enter another number (unless it's 0)