title: Display decimals two digits unless integer
body: <p>Multiplication of two numbers</p>
  <pre><code>$(document).ready(function () {
      $(&quot;#input1, #input2&quot;).change(function () {
          var num = parseFloat($(&quot;#input1&quot;).val()) * parseFloat($(&quot;#input2&quot;).val());
  
          if (num % 1 != 0) {
              num = Math.floor(num * 100) / 100;
          } else {
              num = parseInt(num);
          }
  
          $(&quot;#input3&quot;).val(num);
      });
  });
  </code></pre>
  <ul>
  <li><p>If the result is integer as 10, it is written as 10. It is ok for me.</p>
  </li>
  <li><p>If the result is as 10.01, it is written as 10.01. It is ok for me.</p>
  </li>
  <li><p>But if the result is as 10.10, it is written as 10.1 instead of
  10.10.</p>
  <p>How do display &quot;always&quot; two digits only if there is any decimals?</p>
  </li>
  </ul>