I would use Convert.ToDecimal instead of Val.
Also surround it in a TRY to catch errors. You should look into only allowing numbers and the decimal point to be entered into rtbA and rtbB, to get the error when entered.
The rounding code (commented out) will round to 2 decimal places.
Code:
Dim Answer As Decimal
Try
Answer = Convert.ToDecimal(rtbA.Text) + Convert.ToDecimal(rtbB.Text)
rtbAnswer.Text = Answer.ToString("c")
'If you need to Round the answer
'Answer = Math.Round(Answer, 2)
'rtbAnswer.Text = Answer.ToString
Catch ex As Exception
rtbAnswer.Text = "Error"
End Try Hope that helps.
Bookmarks