TITLE: Setting output width with iostreams PROBLEM: LEVITTE@e.kth.se (Richard Levitte) I personally like the C++ iostreams very much, and I find the operator<<(ostream&, ) quite usable, except for one thing. There is no way, as far as I know, to specify a field size for some particular argument to output. What I would like is something similar to printf("%6.4f", f)! Is this possible? Is there some predefined manipulator I can use, or do I have to do this myself? RESPONSE: steve@taumet.com (Steve Clamage), 1 Mar 93 Use the "width" and "precision" functions in the stream. The give effectively the same result as with printf formats. cout.width(6); cout.precision(4); cout << f; More conveniently, two manipulators are provided in : cout << setw(6) << setprecision(4) << f;