title: Rounding off floats with ostringstream
body: <p>I have an issue regarding conversion from float to c++ string using ostringstream. Here is my line:</p>
  
  <pre><code>void doSomething(float t)
  {
      ostringstream stream; 
      stream &lt;&lt; t;
      cout &lt;&lt; stream.str();
  }
  </code></pre>
  
  <p>when t has value -0.89999 it is round off to -0.9, but when it's value is 0.0999 or lesser than this say 1.754e-7, it just prints without round off. what can be the solution for this.</p>