Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //How to output with 3 digits after the decimal point with C++ stream?
- #include <iostream>
- using namespace std;
- int main () {
- double f = 113.;
- cout.setf(ios::fixed,ios::floatfield);
- cout.precision(3);
- cout << f << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement