Jump to content
  • Advertisement

Archived

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

acw83

iostream question

This topic is 5553 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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!