"Brandon" <bcr07548@creighton.edu> wrote in message news:24f6b708.0407191909.3a723d00@posting.google.c om...[color=blue]
> In a program, I'm using an ostringstream to convert a floating point
> value to a string. When the numbers are big enough, they are
> converted using scientific notation. To fix this, I changed the code
> to
> oStream << fixed << myFloat;
> but now there are an unnecessary amount of trailing zeros that I don't
> want. I seem to recall something in C, using printf(), where you
> could specify how many places you wanted. For examples, using
> something like printf("%1.2", 0.45678) would print the text "0.45".
> Is there any way to force a certain number of decimal places in C++
> using ios streams (ostringstreams in particular)?
>
> -Brandon[/color]
You might use also C-like printf format with C++ ostream; float format sample can be seen at
http://groups.google.com/groups?selm....uni-berlin.de.
--
Alex Vinokur
http://mathforum.org/library/view/10978.html http://sourceforge.net/users/alexvn