I have created a small currency calculation program in vb.net. But when I am calculating two currency values, it is showing the wrong amount. My text boxes are already in currency format. Kindly looking for your help please.
Here is my code for calculation:
txtBalance.Text = Val(txtPayment.Text) + Val(txtTotalAmount.Text)
CDbl(Val(txtPayment.Text))try looking at this: stackoverflow.com/questions/1172306/convert-string-to-double-vbDim payment = Decimal.Parse(txtPayment.Text)String = (Assumed number from string) + (Assumed number from string)- adding apples and wanting oranges! Should beNumber = (parsed number from string) + (parsed number from string)