0

hey guys,
im sure this is a really easy thing to do but, im currently trying to make a form that basically you enter numbers into three text boxes and it pumps and the sum in a label. I've got this working fine except for decimal places. using code" label.text = int(val(txtbox.text) +val(txtbox2.text)) "
i haven't done any coding in vb since 1996 so im a little hazy i think it has something to do with the int but not sure.

any help would be great
thanks

3
Contributors
6
Replies
7
Views
10 Years
Discussion Span
Last Post by hollystyles
0

You are right integer variables don't have decimal places, they are for whole numbers only. Use float double or decimal variables.

0

thanks guys csng worked a charm.... is there a way to make it display 2 decimal places as in a currency 100.10?? it works ok if you have used 2 decimal places providing last one isn't a zero.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.