title: Round double to 3 points decimal
body: <p>Currently, I can round a <code>double</code> to an output stream using:</p>
  
  <pre><code>output.setf(std::ios::fixed,std::ios::floatfield);
  output.precision(3);
  </code></pre>
  
  <p>But I'm given a <code>double</code> and I need to make the conversion before I insert it to a vector. So for instance, if the number <code>-0.00078</code> appears then it equals to <code>0.000</code> and I won't need to save it. On the other hand, <code>1.0009</code> will become <code>1.001</code> (same as the precision function handles it).</p>
  
  <p>How can I convert doubles like that in C++?</p>