:?: how do I get the high-lighted lines below to round up to just two (2) decimal places using the setprecision
// Program description: Calculate the price, including taxes, of a water bill
// given the amount of water in gallons
// Author: Eric Martin
// Date: 10.21.2004
#include <iostream>
#include <conio.h>
#include <iomanip>
using namespace std;
int main (){
// Declare identifiers
float Water;
float Srate;
float Wrate;
float Gallons;
float Taxes;
float Total1;
float Total2;
// Initiailize identifiers
cout << " How much water was used in one month?: ";
cin >> Water;
// Formulate
Gallons = Water / 100;
Wrate = Gallons * .021;
Srate = Gallons * .001;
Total1 = Wrate + Srate;
Taxes = Total1 * .02;
Total2 = Total1 + Taxes;
std::cout << " The amount of water used this month----------" << Gallons << endl;
[COLOR=Red]std::cout << " Amount due for use of water---------- " << setprecision(0) << Wrate << endl;
std::cout << " Amount due for sewage---------- "<< setprecision(0) << Srate << endl;
std::cout << " Total water and sewage charge---------- " << setprecision(0) << Total1 << endl;
std::cout << " Total amount of taxes---------- " << setprecision(0) << Taxes << endl;
cout << " TOTAL AMOUNT DUE---------- " << setprecision(0) << Total2 << endl;[/COLOR] getch();
return 0;