title: JavaScript built-in alternatives to toFixed() rounding
body: <p>To round a decimal number with the <code>.toFixed()</code> method in JavaScript, I would expect that the ending of ...5 should be rounded up.</p>
  <p>As the example shows, in the case of 5.555, the <code>.toFixed(2)</code> method will result in 5.55 although my expectation would be 5.56 due to the rounding standards.</p>
  <p>Is any built-in JavaScript or jQuery method for rounding numbers following the international mathematical rounding?</p>
  <hr />
  <p>Edit: Using <code>Math.round()</code> is acceptable and understandable, just the number shall be multiplied and divided. I was curious if there is any existing <strong>simplified function</strong>, like the <code>toFix()</code> just with a solution on the rounding of 5's. Of course it possible to write a function for it or use the Math.round with proper parameterization.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
  &lt;body&gt;
  
    &lt;p&gt;Click the button to display the fixed number.&lt;/p&gt;
  
    &lt;button onclick="myFunction()"&gt;Try it&lt;/button&gt;
  
    &lt;p id="demo"&gt;&lt;/p&gt;
  
    &lt;script&gt;
      function myFunction() {
        var num = 5.555;
        var n = num.toFixed(2);
        document.getElementById("demo").innerHTML = n;
      }
    &lt;/script&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>