Page 1 of 1

How to show the '0' after '.'?

Posted: Mon Oct 02, 2006 11:24 pm
by payton1
How to show 3.00000 rather than 3?

Posted: Mon Oct 02, 2006 11:57 pm
by mf

Code: Select all

printf("%.5f\n", 3.0);
or

Code: Select all

cout.setf(ios::fixed);
cout.precision(5);
cout << 3.0 << endl;

Posted: Tue Oct 03, 2006 12:11 am
by payton1
thank you to solve it