Archived

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

double format

This topic is 5312 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

Hi! I have double b = 0.1; is there a function, which adds me an 0 to b? b = 0.10 I know it sounds silly. But i have an simple math programm (learning simple math stuff with computer). And I need an output with two decimal figure. I save two numbers in an stringstream and then return the string: stream << a << " " << b << " | "; Christian

Share this post


Link to post
Share on other sites
quote:
Original post by RuneLancer
I''m going to get chewed on for this...
Indeed: the header should be <cstdio>, and you''ll want to call ios::sync_with_stdio(); somewhere.

Share this post


Link to post
Share on other sites