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.
|
|
|
|
|
![]() |
||
my site - can i add 2 figures?
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
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! |
|
|
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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) |
|
#4
|
|||
|
|||
|
That worked beautifully!!!!!
Thanks alot Nitesh (Dont think thats it though as im surte theres plent of questions to come. :wink: ) |
![]() |
| Tags |
| site, add, figures |
| Thread Tools | |
|
|
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 |