title: Best way to round a number in javascript to a certain decimal places
body: <p>I use this method to round numbers to decimals:</p>
  
  <pre><code>function roundTo(x, d) {
      var p = Math.pow(10, d || 0);
  
      return Math.round(x * p) / p;
  }
  </code></pre>
  
  <p>But unfortunately cause of Javascript's floating point this will happen:</p>
  
  <pre><code>roundTo(23232323232323232, 15) -&gt; 23232323232323230
  </code></pre>
  
  <p>What's the best way to fix this?</p>