nummbers are without decimal point

How can I get the real numbers?
After pressing command button I get xxx instead of xxx.xx
Here is the program:

Option Explicit
Dim aantal1 As Integer
Dim aantal2 As Integer
Dim bedrag1 As Integer
Dim bedrag2 As Integer
Dim totaal As Integer
Dim geld1 As Integer
Dim geld2 As Integer
Dim totaalgeld As Integer

Private Sub Command1_Click()
bedrag1 = 10.06
bedrag2 = 200.78
aantal1 = Text1.Text
aantal2 = Text2.Text
geld1 = bedrag1 * aantal1
geld2 = bedrag2 * aantal2
totaalgeld = geld1 + geld2

Label1.Caption = geld1
Label2.Caption = geld2
Label3.Caption = totaalgeld
End Sub

Many thanks


  • You cant get decimals out of integers... I'm not a VB programmer but in C/C++/C# you would declare the variables like float or double...

  • Thanks, I made them single now and that worked.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!