type casting/type conversion not working

Hey guys, have to write a beginner's program( I realize there are more efficient ways to perform some things, but have to keep it simple for this assignment). Estimated amount to be paid in taxe
Last edited on
By default it only shows decimals if it affects the value. If all decimals, to a certain level of precision, are all zeroes it will not show any decimals.

If you include <iomanip> and run the following code before outputting you will see two decimal places for all values.

 
cout << fixed << setprecision(2) << endl;

http://www.cplusplus.com/reference/ios/fixed/
http://www.cplusplus.com/reference/iomanip/setprecision/
Last edited on
Topic archived. No new replies allowed.