Archived

This topic is now archived and is closed to further replies.

iostream question

This topic is 5336 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there a way to limit the number of digits to be displayed after the decimal point? I know that cout.setprecision can be used to set the total number of digits, but I seek only to limit the number of digits after the decimal point. I know I could do some integer math and print the decimal part of a number seperately, but in that case I might as well use printf, which I do not prefer.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
the documentation you have for setprecision might also have some for number of decimal places

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang98/html/_iostream_setprecision.asp

Share this post


Link to post
Share on other sites