#include <iomanip> 
#include <iostream> 
using namespace std; 
  
int main() 
{ 
  double a = 54.214; 
  
  // set to 2 digits after the decimal (see 4.2) 
  cout.setf(ios::fixed|ios::showpoint); 
  cout << setprecision(2); // applies until set to something else 
  
  // output with current formatting (see 3.4.1) 
  cout << "formatted a = " << a << endl; // 54.21 (rounded off!) 
  
  // turn off format, so show a number "as is" (new) 
  cout.unsetf(ios::fixed|ios::showpoint); 
  cout << setprecision(6); // resets precision to its default 
  
  // output without formatting, and with a label (see 3.4.1) 
  cout << "unformatted a = " << a << endl; // 54.214 (original) 
} 
