Set the uppercase flag for double value : double output « Data Type « C++






Set the uppercase flag for double value

  
#include <iostream>

using namespace std;

int main()
{
  int x = 100;
  double f = 98.6;
  double f2 = 123456.0;
  double f3 = 1234567.0;

  // Set the uppercase flag.
  cout << "Setting uppercase flag.\n";
  cout.setf(ios::uppercase);
  cout << "f3 with uppercase flag set: " << f3 << endl;

  return 0;
}
  
    
  








Related examples in the same category

1.Set showpos flag for double
2.Set fixed flag for double value
3.Set scientific flag when outputing double
4.Scientific format with precision of 7
5.Fixed format with precision of 7
6.Set the precision to 9
7.double: Formatting aligns columns, pads blank spaces with '0' character, and controls precision of answer.