title: Rounding off floating numbers in cpp
body: <p>For a particular question, I need to perform calculations on a floating number, round it off to 2 digits after the decimal place, and assign it to a variable for comparison purposes. I tried to find a solution to this but all I keep finding is how to print those rounded numbers (using <code>printf</code> or <code>setprecision</code>) instead of assigning them to a variable.
  Please help.</p>