I know you can manipulate output precision using std::setprecision( int ) found in iomanip if that helps.
You can also calculate it like this:
double yourNumber,
numberAfterRounding,
precision = 6;
numberAfterRounding =
floor( yourNumber * pow( 10, precision ) + .5 )
/ pow( 10, precision );
Note: include cmath.