|
|
 |
| Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Basics section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

November 29th, 2005, 06:04 AM
|
|
Registered User
|
|
Join Date: Nov 2005
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
negative number returned when subtracting
Hello wondering if anyone can help me.
I am performing a calulcation on two numbers (a - b) that are not always the same and i get returned a negative number which is incorrect.
For example if a = 10, and b = 7 then 10 - 7 = 3, but if a = 7, and b = 10 then 7 - 10 = -3.
i am just wondering how in asp code i can fix it so that the result would always be 3 and not -3
Any help would be appreciated
G.
|

November 29th, 2005, 06:16 AM
|
|
Friend of Wrox
|
|
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 685
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
You can use Abs() to do this...
HTH,
Chris
|

November 29th, 2005, 06:34 AM
|
|
Registered User
|
|
Join Date: Nov 2005
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks alot, will try to use abs. Was just starting to write if a > b then make highNumber else make lowNumber etc..
Abs will save me alot of time as have many calculations to perform
G.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |