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.
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