Hi
ive included
#include <iomanip.h>
and im using setprecision(2) to set the precision for my floats
The problem is that when i execute the program i now get 1.4E+ee etc when i want say 44.67
Am i missing something?
Hi
ive included
#include <iomanip.h>
and im using setprecision(2) to set the precision for my floats
The problem is that when i execute the program i now get 1.4E+ee etc when i want say 44.67
Am i missing something?
Try:
float f = 44.67;
cout << setiosflags(ios::fixed) << setprecision(2) << f << endl;
Thanks that worked.