Results 1 to 2 of 2

Thread: Strange Subtraction problem

  1. #1
    Join Date
    Jul 2002
    Hastings, UK

    Unhappy Strange Subtraction problem

    Hi all

    I have this really anoying problem when trying to do a very simple subtraction, as follows.

    The number2 value is always 14, and the number1 value always changes.

    Now if the number1 value is lower than 4 then it works fine, but when its higher than 4 say 5 then the miles_val goes into minus e.g -5 when it should obviously be doing this 14 - 5 = 9

    Here is the code

    number1 = replace(request.querystring("number1"))
    number2 = replace(request.querystring("number2"))

    if number1 < number2 then
    horizontal_num = number2 - number1
    miles_val = miles_val + horizontal_num
    end if

    Any ideas why the number would be jumping to minus when it reaches 10? is it only counting the last 0 digit maybe?

  2. #2
    Join Date
    Jun 2004
    What is the initial value of miles_val and is it reset between calculations?

Similar Threads

  1. Internet Explorer Page Cannot Be Displayed Problem
    By y2ksrs in forum General Questions
    Replies: 0
    Last Post: 16 Sep 2005, 04:13 AM

Posting Permissions

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