I need to be two decimals precise therefore I am using this code
How come this isn't working ?Code:outData << setw(10) << set iosflags(ios::fixed) << setprecision(2) << totalGP;
I need to be two decimals precise therefore I am using this code
How come this isn't working ?Code:outData << setw(10) << set iosflags(ios::fixed) << setprecision(2) << totalGP;
What do you mean by not working, what are you getting exactly?
Post the hole code, it's not cauesd by this statement.
Maybe totalGP is not float or double!
Try "setiosflags(ios::fixed);" rather than separating 'set' and 'iosflags' with a space.
May be just a 'typo' in your post, but let's not overlook the obvious.
-Skipper
"When the only tool you own is a hammer, every problem begins to resemble a nail." Abraham Maslow
Code:cout << fixed << setw(10) << setprecision(2) << totalGP;
Mr. C: Author and Instructor