M
Martin
Hi.
My question seems to be somewhat primitive, but I cannot find an
appropriate solution. Is it possible to control the number of digits
displayed in the exponent part of the scientific notation? I can use
'precision()' member function or 'setprecision' manipulator to control
the number of digits after the point:
cout.setf(ios_base::scientific, ios_base::floatfield);
cout.precision(8);
cout << 643.2963 << endl;
The result is 6.43296300e+002 with my stdlib. I want it to be printed
with 2 digits in exponent part, i.e. 02, not 002. How to achieve that?
Thanks in advance
Martin
My question seems to be somewhat primitive, but I cannot find an
appropriate solution. Is it possible to control the number of digits
displayed in the exponent part of the scientific notation? I can use
'precision()' member function or 'setprecision' manipulator to control
the number of digits after the point:
cout.setf(ios_base::scientific, ios_base::floatfield);
cout.precision(8);
cout << 643.2963 << endl;
The result is 6.43296300e+002 with my stdlib. I want it to be printed
with 2 digits in exponent part, i.e. 02, not 002. How to achieve that?
Thanks in advance
Martin