Label9.Caption = CLng(Text1) + CLng(Text2)
Label9.Caption = Format(Label9.Caption, "###,###.##")
text1 = 22.50
text2 = 12.40
label9 = 35
What am I doing wrong?
Thanks,
Wayne
Printable View
Label9.Caption = CLng(Text1) + CLng(Text2)
Label9.Caption = Format(Label9.Caption, "###,###.##")
text1 = 22.50
text2 = 12.40
label9 = 35
What am I doing wrong?
Thanks,
Wayne
clng is rounding for you because long is a long integer. Try Cdbl to convert you text to doubles
What's the problem?
Hi HeSaidJoe,
The CLng Function is rounding your label values to Integers. Try this instead:All the best.Code:Label9.Caption = CSng(Text1) + CSng(Text2)
Label9.Caption = Format(Label9.Caption, "###,###.##")
Thanks all...I didn't realize lng was an integer.
I would use val, cuz it takes all values
Label9.Caption = Format(VAL(Text1) + VAL(Text2) , "###,###.##")