How to allow only numbers in textbox in reactjs using regular expression only?
textbox
reactjs
regular expression
countDecimals(value) { return value % 1 ? value.toString().split(".")[1].length : 0; }; handleOnChangeAmount(id, e) { let count = this.countDecimals(e.target.value); if (count === 3) { e.preventDefault(); } }