title: How to get my total to update correctly in vb.net (using textchanged event)
body: <p>What i have in a text box that is the discount.  The text box talks to the label as you type and updates it accordingly</p>
  
  <p>The problem is that once the discount_rate.text get to 10 or above the discount is off by 5 cents and increases as the number goes up..</p>
  
  <p>Can anybody tell me why?</p>
  
  <pre><code>Private Sub discount_rate_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles discount_rate.TextChanged
      Select Case radio
          Case "one"
              If discount_rate.Text = "" Then
                  Label17.Text = FormatCurrency(a_total.Text * 50)
                  Label19.Text = FormatCurrency(Label17.Text * 0.06)
                  a = CDbl(Label17.Text)
                  b = CDbl(Label19.Text)
                  Label21.Text = FormatCurrency(a + b)
              Else
                  discount = discount_rate.text / 100
                  discountrate = Label17.Text * discount
                  dis_count1.Text = FormatCurrency(discountrate)
                  Label17.Text = FormatCurrency((a_total.Text * 50) - discountrate)
                  Label19.Text = FormatCurrency(Label17.Text * 0.06)
                  a = CDbl(Label17.Text)
                  b = CDbl(Label19.Text)
                  Label21.Text = FormatCurrency(a + b)
  </code></pre>