Ok, I'm creating this calculator for someone I know... But I ran into a problem...This thing doesn't do decimal's. What it basicly is, is trying to take the data from 4 text boxes and add them up into a label, then take that anwser and multiply it by 0.06. It works fine...unless you use a decimal, then it will just add up the 1st number in each text box... So please help if you can...I'm sort of a begginner...but get the concept...just have this little problem...
Thanks in advance for any help given
Thanks in advance for any help given
VB.NET:
Private Sub cmdSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSubmit.Click
Dim add, add2, add3, add4 As Integer
add = Val(txtPrice1.Text)
add2 = Val(txtPrice2.Text)
add3 = Val(txtPrice3.Text)
add4 = Val(txtPrice4.Text)
lblTest.Text = Format(add + add2 + add3 + add4, "currency")
lblTest2.Text = Format(lblTest.Text * 0.06 + lblTest.Text, "currency")
End Sub