fixed/scientific
stream manipulators
ios_base& fixed ( ios_base& str );
ios_base& scientific ( ios_base& str );
ios_base
  cplusplus.com  

Selects a floating-point notation format flag
  fixed notation inserts floating-point values with no exponent field.
  scientific notation inserts floating-point values with exponent.

Parameters.

str
Stream object where to apply. This is a manipulator parameter.

Return Value.
  A reference to the stream object.

Example.

// modify floatfield using manipulators
#include <iostream>
using namespace std;

int main () {
  float f;
  f=365.25;
  cout << fixed << f << endl;
  cout << scientific << f << endl;
  return 0;
}
The execution of this example shall display:
  365.250000
  3.652500e+002

See also.
  flags, setf, unsetf
  ios_base class


© The C++ Resources Network, 2001