5
Answers

Rounding Up Troubles

Ask a question
Sonny Thai

Sonny Thai

16y
2k
1

Alright, heres the deal: For some reason the program rounds my answers up. If the total is $3.65, it outputs $4. The program deals with sales so its gotta be precise. I cant figure it out how to make to show the exact price with the change and not round up.

 

decSubTotal = SelectPhone() * txtNumberOfPhones.Text

decTax = decSubTotal * intTAX_RATE

decTotal = SelectOption() + SelectPackage()

lblSubTotal.Text = FormatCurrency(decSubTotal, 2)

lblTax.Text = FormatCurrency(decTax)

lblTotal.Text = FormatCurrency(decSubTotal + decTax)

lblOptions.Text = FormatCurrency(SelectOption())

lblPackageCharge.Text = FormatCurrency(SelectPackage())

lblTotalCharges.Text = FormatCurrency(decTotal * txtNumberOfPhones.Text)


Answers (5)