|
|
back to boardCommon Boardc++ whit decimals How do I print a folat or double with 2 decimals in c++?? in c is printf("%f.2",x) but in c++? I know this: #include <iomanip.h> fout<<setprecision(2)<<x; but this dosen't work under linux. Re: c++ whit decimals try printf("%.2f", x) you could read BC's help on printf. There are useful things said there |
|
|