Question : subtract 10% from textbox

hi,
   I have a button which when pressed changes the background colour, I also want it to deduct 10% from the total of a textbox, then when clicked, change the colour back and reapply the 10%. ....  The code so far is:

       If percent10.BackColor = Color.LightGray Then
            percent10.BackColor = Color.Red
            discountlabel.Text = "10% Discount Applied"
            lbltotal.Text = Format(Val(lbltotal.Text) / 10, "0.00")
        Else

            percent10.BackColor = Color.LightGray
            discountlabel.Text = ""
            lbltotal.Text = Format(Val(lbltotal.Text) * 0.1, "0.00")
        End If

This gives some strange results though and I can't work out where I am going wrong.  Can anyone help?

Thanks

Answer : subtract 10% from textbox

a 10% discount is NOT what you get when you divide by 10.  Rather a 10% discount is the original value MINUS10%of that original value

Discount = 0.1* OriginalValue
DiscountedValue = OriginalValue - Discount

then, to get the orginal value back again, you would add the Discount to the DiscountedValue:

OriginalValue = DiscountedValue + Discount
Random Solutions  
  •  Php 500 internal server error received on website but not using xampp at home
  •  subquery returned more than 1 value: database vendor code 512
  •  Microsoft Access Database Engine 2010 Redistributable and "OpenRowSet"
  •  Delivery not authorized, message refused. 550-5.7.1 Message targeted to organization's federated delivery mailbox.
  •  Itunes could not connect to the Itunes Store. The network connection timed out.
  •  mySQL complicated unions and subqueries
  •  how to hide/ view columns in a gridview using checkboxes in CustomEditorpart in sharepoint
  •  Zebra LP 2844 label printer prints the first print job successfully, subsequent print jobs after skip labels and/or print partial data on labels until computer is rebooted.
  •  breadcrumb trail in a dropdown box
  •  IIS 6.0 asp.net 2.0 cpu performance issue
  •  
    programming4us programming4us