+ Reply to Thread
Results 1 to 2 of 2

Do Until problem

  1. #1
    David Goodall
    Guest

    Do Until problem

    Morning
    I've set up a do until loop but it doesn't stop when the two conditions
    appear to be the same.

    The two variable I'm comparing are declared as Double and I think that's
    where the problem lies. When I debug the watches are as follows:-

    Variable1 = 39779.4028
    Variable2 = 39779.4028

    They appear to be the same but I'm thinking that not all the decimals are
    being shown. I only need the answers to 2 decimal points ie 39779.40 so
    would you suggest casting the double to another variable type.

    Hope this makes sense.
    Thanks
    David




  2. #2
    Bob Phillips
    Guest

    Re: Do Until problem

    David,

    How about

    Do
    ...
    Loop Until Round(var1,2) = Round(var2,2)


    --
    HTH

    Bob Phillips

    "David Goodall" <[email protected]> wrote in message
    news:[email protected]...
    > Morning
    > I've set up a do until loop but it doesn't stop when the two conditions
    > appear to be the same.
    >
    > The two variable I'm comparing are declared as Double and I think that's
    > where the problem lies. When I debug the watches are as follows:-
    >
    > Variable1 = 39779.4028
    > Variable2 = 39779.4028
    >
    > They appear to be the same but I'm thinking that not all the decimals are
    > being shown. I only need the answers to 2 decimal points ie 39779.40 so
    > would you suggest casting the double to another variable type.
    >
    > Hope this makes sense.
    > Thanks
    > David
    >
    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1