title: Force number input to have two decimal places and ONLY two
body: <p>How can I format the following input for a price to be forced to have two decimal places and ensure that it allows only two places?</p>
  
  <p>So, for example, if the value is '1', it will be changed to '1.00' automatically, and '1.111' will be changed to '1.11'.</p>
  
  <p>I've already tried step="0.01", but this won't work.</p>
  
  <p>JSFiddle: <a href="https://jsfiddle.net/eub68raq/" rel="nofollow noreferrer">https://jsfiddle.net/eub68raq/</a>.</p>
  
  <p>HTML: </p>
  
  <pre><code>&lt;input data-number="Quantity must be a number" data-required="Unit price required" min="0" step="0.01" id="unitPrice" value="" type="number" name="unitPrice" placeholder="Unit Price"/&gt;
  </code></pre>
  
  <p>JS I've tried:-</p>
  
  <pre><code>var number = $('input#unitPrice').val();
  $('input#unitPrice').innerHTML = parseFloat(Math.round(number * 100) / 100).toFixed(2);
  </code></pre>