Given a variable of float type, how to output it with 3 digits after the decimal point, using iostream in C++?
This one does show "13.141"
#include #include using namespace std; int main(){ double f = 13.14159; cout << fixed; cout << setprecision(3) << f << endl; return 0; }