title: formatting decimals in javascript
body: <p>i want to format a number to max of 2 decimals in javascript.  i see that there is:</p>
  
  <pre><code>toFixed(2)
  </code></pre>
  
  <p>but this seems like it would ALWAYS do 2 decimals.  i want something that would take:  100.1223334 and convert it to 100.12 but i want this function to convert 100.5 to just 100.5 (since &lt; 2 decimal digits)</p>
  
  <p>whats is the best way of doing this in javascript.</p>