title: How to allow only digits along with decimal on react input
body: <p>i wanted to allow only digits with decimal on react input and do some condition based on the value got, below what i tried which works fine but with problem mentioned below</p>
  
  <pre><code>&lt;FormInput
     name="amount"
     label="Amount"
     onChange: this.handleChange,
     startAdornment: (&lt;InputAdornment position="start"&gt;$&lt;/InputAdornment&gt;),
     pattern: '[0-9]*',
  /&gt;
  </code></pre>
  
  <pre><code>handleChange = (event) =&gt; {
      const { value } = event.target;
      const validValue = Math.abs(parseFloat(value));
      if (validValue &amp;&amp; !isNaN(validValue)) {
        // some condition...
        // i have some other set of value that i compare here with input got like if
        // 1) validValue &gt; someValue, then this.setState({ someValue })
        // 2) validValue &lt;= someValue, then this.setState({ validValue })
        // 3) else this.setState({ validValue: 0 })
      }
    }
  </code></pre>
  
  <p>But the problem here is i am not able to enter decimal along with other digits, like i need to enter 1.2 then first i need to enter 12 and then add '.'(decimal) before 2, so please help me what i can do to allow digits with decimal along other digits</p>