|
-
Aug 8th, 2000, 03:50 AM
#1
Thread Starter
Hyperactive Member
Hey, i use the code
Equals = Str(Val(text1.text) + val(text2.text))
and it works perfectly..
altho i need it to Add decimals..
(if u try this out with a decimal, it ROUNDS the decimal..)
like money, so
$2
$2.10
$3.00
would = 7.10
How would i do this? thanks
-
Aug 8th, 2000, 04:22 AM
#2
Lively Member
Use the Format command.
result = FORMAT("7", "#0.00")
This should convert '7' to '7.00'
Hope this is of some help
-
Aug 8th, 2000, 08:20 AM
#3
You can omit the pound sign.
Code:
Equals = Str(Text1) + Val(Text2)
Equals = Format(Equals, "0.00")
Print Equals
-
Aug 8th, 2000, 08:25 AM
#4
Junior Member
Did you Dim Equals as Integer?
-
Aug 8th, 2000, 04:44 PM
#5
Thread Starter
Hyperactive Member
THANKS.. but its not there yet..
i type in
2
2.00
and
2.56
in the 3 boxes that i have..
When i ADD THEM ALL UP
it just appears as
7.00
it is still ROUNDING the .56
how would i do this so it adds all the CENTS up, which it isn't doing it is just rounding
Thanks
-
Aug 8th, 2000, 04:55 PM
#6
Try this.
Code:
Dim Equals As String
Equals = Str(Val(Text3) + Val(Text2) + Val(Text1))
Equals = Format(Equals, "0.00")
Print Equals
[Edited by Megatron on 08-08-2000 at 05:58 PM]
-
Aug 8th, 2000, 05:30 PM
#7
Thread Starter
Hyperactive Member
EXCELLENT!
THANKS
U are truely the guru
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
|