Display 0.999 as 0.99
<p>How can I display a <code>float number = 0.999</code> as <code>0.99</code>?</p>

<p>The code below keeps printing out <code>1.00</code> ? I thought using <code>setprecision(2)</code> specifies the number of digits after the decimal point? </p>

<pre><code>#include &lt;iostream&gt;
#include &lt;iomanip&gt;

using namespace std;


int main(int argc, char** argv) 
{     
  const float numberToDisplay = 0.999;
  cout &lt;&lt; setprecision(2) &lt;&lt; fixed &lt;&lt; numberToDisplay &lt;&lt; endl;

  return 0;
}  
</code></pre>
