title: Truncate a float in Erlang
body: <p>I am using a function to create a list from a float.</p>
  
  <pre><code> float_to_list(0.02).
  </code></pre>
  
  <p>It returns:</p>
  
  <pre><code>"2.00000000000000000000e-002"
  </code></pre>
  
  <p>I need it to give me a number exactly like:</p>
  
  <p>"0.20"</p>
  
  <p>If I fed it 5.23</p>
  
  <p>"5.23"</p>
  
  <p>If I fed it 5.5</p>
  
  <p>"5.50"</p>
  
  <p>So basically the number rounded to two decimal places.
  Probably an easy fix.</p>
  
  <p>Thanks</p>
  
  <p>EDIT:</p>
  
  <p>I would like to use the io format it looks like it might work,</p>
  
  <p>but it dosen't in this example:</p>
  
  <pre><code>wxTextCtrl:setValue( TcGrossProfit, io:format("~p", [NUMBER]), ),
  </code></pre>
  
  <p>seems textctrl wants a string,  I don't want to print it to the screen.</p>