title: Ruby code to remove insignificant decimal places?
body: <p>I would like to get an elegant code, which removes the insignificant closing zeroes, eg:</p>
  
  <pre><code>29.970 =&gt; 29.97
  29.97 =&gt; 29.97
  25.00 =&gt; 25
  25.0 =&gt; 25
  </code></pre>
  
  <p>I tried:</p>
  
  <pre><code>argument.to_r.to_f.to_s
  </code></pre>
  
  <p>But doesn't work in every cases, eg on 25.00 gives 25.0</p>