C++ Rounding to the _nths place
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1343890/rounding-number-to-2-decimal-places-in-c">Rounding Number to 2 Decimal Places in C</a>  </p>
</blockquote>



<p>I'm currently learning c++ on a linux machine. I've got the following code for rounding down or up accordingly but only whole numbers. How would I change this code to round to the hundredths place or any other decimal? I wouldn't ask if I didn't try looking everywhere already :( and some answers seem to have a ton of lines for what seems to be a simple function!</p>

<pre><code>double round( double ){
return floor(value + 0.5 );
}
</code></pre>
