title: Rounding in Javascript
body: <p>I'm trying to do a simple conversion, and I want to round the number of converting an inch to centimeters. 1 inch is basically 2.54 CM, but if we round it up it would be 3. I'm not sure what I'm doing wrong here:</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-js lang-js prettyprint-override"><code>$("#ConvertInchCm").click(function(e){
      e.stopPropagation();
      var val = $('#value').text()
      if(($(this).text() == "Convert to CM"))
      {
           $("#value").text(val*2.54);
           Math.round($(val).text());
           $(this).text("Convert to Inches"); 
      }
      else
      {
          $("#value").text(val/2.54);
          $(this).text("Convert to CM");
      }
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;button id="ConvertInchCm"&gt;Convert to CM&lt;/button&gt;
  &lt;div id="value"&gt;1&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>