Hi
Please, How I sum 2 textboxs with decimal, I tried with val function and It give me only integer part
Printable View
Hi
Please, How I sum 2 textboxs with decimal, I tried with val function and It give me only integer part
Hi there, I have no problems with this.
But you must make sure of what separator of decimals you use.On my machine if I sum 2.2 + 2.12345 I get 4,32345, BUT if I write 2,2 + 2,12345 I get 4!!!, notice it works with dot, but not with comma, I guess this is what you need to do.
André
Try this
...and have a good weekend...:DCode:
Private Sub Command1_Click()
Dim txt1 As Single
Dim txt2 As Single
txt1 = CSng(Text1.Text)
txt2 = CSng(Text2.Text)
Label1.Caption = Str(txt1 + txt2)
End Sub