title: Round a double number when printing to cout
body: <p>I want to print only one digit after the decimal dot.</p>
  
  <p>So I write:</p>
  
  <pre><code>double number1 = -0.049453;
  double number2 = -0.05000;
  
  cout.setf(ios::fixed,ios::floatfield);
  cout.precision(1);
  
  cout &lt;&lt; number1 &lt;&lt; endl;
  cout &lt;&lt; number2 &lt;&lt; endl;
  </code></pre>
  
  <p>My output is:</p>
  
  <pre><code>-0.0
  -0.1
  </code></pre>
  
  <p>I want that the first line will be <code>0.0</code> (cause <code>-0.0</code> is <code>0.0</code>). How should I change my code that in a case of <code>-0.0</code>, it will print <code>0.0</code>?</p>
  
  <p>And about the second line, why doesn't it print <code>0.0</code> (or <code>-0.0</code>)?</p>
  
  <p>Any help appreciated!</p>