title: I have a number input and I want to convert into decimal react js
body: <p>I want to convert a input type number into two decimal values in the form values, but show to user only integer when there is no decimal.
  for eg 1 -&gt; 1.00 , 2.346 -&gt; 2.34
  As in the first example it should show to user only 1 but in the form values it should be 1.00</p>
  <pre class="lang-js prettyprint-override"><code>&lt;Input
    {...field}
    onKeyDown={e =&gt; decimalPlace(e, form)}
    type=&quot;number&quot;
    step={0.01}
    value={minVal}
    onChange={e =&gt; {
      form.handleChange(e);
    }}
    id=&quot;price&quot;
    isDisabled={isSubmitting}
  /&gt;
  </code></pre>
  <p>As I am using chakra and formik, minVal here is a state which I set in decimalPlace function like below</p>
  <pre><code>form.setFieldValue('targetPriceMin', Number(e.target.value).toFixed(2))
  </code></pre>