wcypierre

c++ output decimal places

Sep 29th, 2011
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.17 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     float f = 3.00f;
  9.     cout << fixed << setprecision(2) << f << endl;
  10.     return 0;
  11. }
  12.  
  13.  
Advertisement
Add Comment
Please, Sign In to add comment