Sonny Thai

Sonny Thai

  • NA
  • 11
  • 0

Rounding Up Troubles

Oct 25 2007 12:30 AM

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)