my site - can i add 2 figures?

This is a discussion on "my site - can i add 2 figures?" within the Classic ASP section. This forum, and the thread "my site - can i add 2 figures? are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices




Closed Thread
 
LinkBack Thread Tools
  #1  
Old May 20th, 2005, 10:52
Junior Member
Join Date: May 2005
Location: Manchester, UK
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
my site - can i add 2 figures?

This is my mess around site...

http://k.domaindlx.com/Nitesh9999/PS...ge%20calc.asp?

No laughing at the back!!

Anyway, im trying to add the 2 watts results to create a total:

watts <%call vbproc(3,DVDRW)%>


watts2 <%call vbproc2(4,DVDRW)%>

so if in the 2 boxes you enter 10 and 20 this total will equal 140

is this possible?

Thanks

Nitesh

**Also i know this is more VB than asp but i couldnt see a VB forum. so if its in the wrong place sorry!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!

  #2  
Old May 20th, 2005, 15:13
Junior Member
Join Date: May 2005
Location: Manchester, UK
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
I've cleaned the site up and it should now be easier to understand (he hopes )

http://k.domaindlx.com/Nitesh9999/P...tage%20calc.asp

If you make 1 selection on each radio button and click caculate watts you will end up with a huge watts figure, this is because the figures from the address bar...

PSU%20Wattage%20calc.asp?CPU=20&RAM=20&GC=70&OD1=2 0&OD2=20&OD3=20

are being multiplied and not added...

20*20*70*20*20*20= watts 224000000

This is because i am using this code...

<%
sub vbproc2(num1,num2,num3,num4,num5,num6)
response.write(num1*num2*num3*num4*num5*num6)
end sub
%>

If i change all the multiply signs (*) for additions ones (+) it doesnt add the figures like this.

20+20+70+20+20+20= watts 170

it returns this...

watts 202070202020

Is there some sort of special plus/addition sign in VB? I've tried substituting the * for / to divide and - to minus/subract and both of these work, its just the + for addition that doesnt work

Any ideas?

Thanks

Nitesh
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #3  
Old May 21st, 2005, 15:07
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 341
Thanks: 0
Thanked 0 Times in 0 Posts
it thinks your numbers are strings and is adding the strings together.

Try converting each value to an Integer (if they are whole numbers) before adding them like:

cint(num1) + cint(num2)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #4  
Old May 21st, 2005, 18:07
Junior Member
Join Date: May 2005
Location: Manchester, UK
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
That worked beautifully!!!!!

Thanks alot

Nitesh (Dont think thats it though as im surte theres plent of questions to come. :wink: )
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Tags
site, add, figures

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
I bring this site up again because, I have no idea how to make this site pull in. TheSealPortalTeam Free Web Site Critique 4 Jun 10th, 2008 12:46
Uploaded site different from local site alowe Web Page Design 20 Mar 28th, 2008 02:20
Website, Web-Site or Web site? Voodoochilli Webforumz Cafe 25 Oct 13th, 2007 01:19
off-site linking to a particular page in a site made with frames. NEED HELP vandiermen Web Page Design 1 Aug 6th, 2006 13:30
[req] Free basic web templates site + button design site slorryy Web Page Design 3 Feb 17th, 2006 17:05


All times are GMT. The time now is 16:01.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42