title: Math.round doesn't work in JavaScript
body: <p>The code is working fine until I add the line inside the function </p>
  
  <pre><code>parseLocalFloatCnt: num = Math.round(num*1.2);
  </code></pre>
  
  <p>Does anyone know how to solve this? Thanks</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
  
  &lt;p&gt;Write something in the text field to trigger a function.&lt;/p&gt;
  
  &lt;input type="text" id="myInput" oninput="myFunction()"&gt;
  
  &lt;p id="demo"&gt;&lt;/p&gt;
  
  &lt;script&gt;
  function myFunction() {
      var x = parseLocalFloatCnt(document.getElementById("myInput").value);
      document.getElementById("demo").innerHTML = "You wrote: " + x;
  }
  function parseLocalFloatCnt(num) {
      num = Math.round(num*1.2);
      return +(num.replace(getLocalDecimalSeparator(), '.'));
  }
  
  function getLocalDecimalSeparator() {
      var n = 1.1;
      return n.toLocaleString().substring(1,2);
  }
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>