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;
Printable View
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
Code:cout << fixed << setw(10) << setprecision(2) << totalGP;