Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - help with sum of values
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

help with sum of values

 Post Reply Post Reply
Author
Mattblack View Drop Down
Groupie
Groupie
Avatar

Joined: 21 January 2003
Location: United Kingdom
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mattblack Quote  Post ReplyReply Direct Link To This Post Topic: help with sum of values
    Posted: 05 May 2003 at 5:39am

please help guys.  Im trying to get the sum of 2 values to be displayed.  Here is an example....

<%
Dim intVar
intVar = request.querystring("number")
%>

<P><%= intVar %> + <%= intVar %> = <%= intVar + intVar %></P>

I want this to display on the page as (Taking number as "4")...
4+4 = 8

Instead i get 4+4 = 44

If i change the script replacing request.querystring("number")
 with the actual number then it works, but i need it to be called from the form or querystring.  Please help!  How do i get around this problem?  Im tearing my hair out.


Cheers peeps

Back to Top
TYSON View Drop Down
Groupie
Groupie


Joined: 18 August 2002
Location: Australia
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote TYSON Quote  Post ReplyReply Direct Link To This Post Posted: 05 May 2003 at 7:37am

Try This
<%
Dim intVar
intVar = Cint(request.querystring("number"))

%>

<P><%= intVar %> + <%= intVar %> = <%= intVar + intVar %></P>

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.