mathematical operations

1. Member
Join Date
Dec 1969
Posts
32

## mathematical operations

hi folks. i&#039;m wondering if someone could help me get started with some sample code on performing simple arithmetic on some variables.<BR><BR>I need to add variable1, variable2, and variable3 together to ensure that they equal variableTotal. It can&#039;t be less than and it can&#039;t be greater than variableTotal. <BR><BR>I&#039;m just looking for some key words that will help me out, as I noticed that simply putting a "+" sign doesn&#039;t do the trick.<BR><BR>Thanks in advance.<BR><BR>Krista

2. Senior Member
Join Date
Dec 1969
Posts
11,247

## RE: mathematical operations

make sure your variables are numeric<BR><BR> &#060;% total = 5.678 + 0.234 + 23.1 %&#062;

3. Member
Join Date
Dec 1969
Posts
32

## having trouble...

having trouble with this<BR><BR>the values of each variable are 1<BR>so when i display the total, I get 111 when I should get 3.<BR><BR>???

4. Senior Member
Join Date
Dec 1969
Posts
1,212

## you're concatenating...

...rather than adding. You need to make sure that your numbers are being treated as numbers, not text.

5. Senior Member
Join Date
Dec 1969
Posts
16,931

## krista cc...

...you might want to find the "VBScript Reference" link on the left and look up the:<BR>CDbl()<BR>and<BR>CInt()<BR>functions.<BR>< BR>Craig.

6. Member
Join Date
Dec 1969
Posts
32

## thanks to all!

thanks to all<BR><BR>i&#039;ll continue to work on it and look up the VBScript items.<BR><BR>-Krista

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•