Let's say I have some calculations as below:
double a = 99.44, result;
result = 99.44 / 100 * 99.5;
The value stored in result will be 98.9428. How do I round the value into 98.94 and store into "result" ?
The setprecision method only can round the value during cout, but I want the value stored to be rounded for further calculations.