title: Javascript: Remove last decimal if zero
body: <p>I have a list of numbers with 3 decimals. I need to remove the last decimal only if it's zero, <em>e.g.</em></p>
  
  <pre><code>var x = 1.500 // I need 1.50
  var y = 1.490 // I need 1.49
  var z = 1.579 // I need 1.579
  </code></pre>
  
  <p>with </p>
  
  <pre><code>var x = 1.500
  var noZeroes = x.toString() // I get "1.5", I need "1.50"
  </code></pre>