What do I do to set number of decimals in C++?
What do I do to set number of decimals in C++?
What do you mean?
"He who makes a beast of himself, gets rid of the pain of being a man." Dr. Johnson
like 12.04 or 12.045 etc?
cout.setf(ios::showpoint);
cout.setf(ios::fixed);
cout.precision(2);
The cout.precision line is what you want the rounding to. 2 means to the nearest hundredth, 3 to the nearest thousandth, etc
Maybe you mean setprecision(), where setprecision(0) means that there are no decimal points...
none...