Jan 14, 2013 at 12:54pm
Hi all!
I have a problem writing a double with no decimals. I know how to decrease decimals with setprecision and fixed.
for example
double one = 3.414, two = 3.514;
cout << one <" " <<two;
How to make the outcome 3 4?
thanks for any help at all!
Jan 14, 2013 at 1:12pm
cout << std::setprecision(0) << one << " " <<two;
Jan 14, 2013 at 2:07pm
thx! :)
it doesn´t seem to work tho..?
Jan 14, 2013 at 3:09pm
What doesn't work? Could you post the code you have so we can see whats wrong? Because it should work.