|
-
Apr 12th, 2004, 08:52 PM
#1
Thread Starter
New Member
question
i have this code:
While (discountsfile.Peek() > -1)
disc = discountsfile.ReadLine()
pos = InStr(disc, " ")
discamounts = CDbl(Microsoft.VisualBasic.Left(disc, pos - 1))
saleamounts = CInt(Mid(disc, pos + 1))
totalPrice = totalPrice - (totalPrice * (saleamounts / 100))
If totalPrice >= discamounts Then
txtdiscount.Text = Format(totalPrice, "Standard")
Exit While
End If
End While
txtPST.Text = Format(PST, "Standard")
GST = Math.Round(totalPrice * GSTrate, 2)
txtGST.Text = Format(GST, "Standard")
txtTotalAmount.Text = Format(totalPrice + PST + GST, "Standard")
when i click the total button, the pst, gst, price, and total amount appear in different text boxes.
the problem is that if i click the total button again, it will accumulate in price.
the exit while doesn't work.
how can i make it so that the price, pst, gst, and total text box amounts don't keep accumulating when i click the button?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|