|
-
Mar 27th, 2000, 12:46 AM
#1
Thread Starter
_______
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
-
Mar 27th, 2000, 12:55 AM
#2
Frenzied Member
clng is rounding for you because long is a long integer. Try Cdbl to convert you text to doubles
-
Mar 27th, 2000, 12:56 AM
#3
Hyperactive Member
-
Mar 27th, 2000, 12:57 AM
#4
Fanatic Member
Hi HeSaidJoe,
The CLng Function is rounding your label values to Integers. Try this instead:
Code:
Label9.Caption = CSng(Text1) + CSng(Text2)
Label9.Caption = Format(Label9.Caption, "###,###.##")
All the best.
-
Mar 27th, 2000, 01:02 AM
#5
Thread Starter
_______
Thanks all...I didn't realize lng was an integer.
-
Mar 27th, 2000, 04:26 AM
#6
transcendental analytic
I would use val, cuz it takes all values
Label9.Caption = Format(VAL(Text1) + VAL(Text2) , "###,###.##")
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|