Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2002
    Location
    Oakland, CA
    Posts
    126

    Unanswered: Modulus and check on integer value

    I've a double variable containing hunderds of values. For me to move on, I want to grab only integers of that variable. Thought it was easy - if (variable mod 1 = 0) then move on. But that yields all the records anyway, because for example 1.2 mod 1 still yields 0, thus to my program it's still an integer. Is there a way to validate whether a number is an integer???

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Check for a decimal point ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Nov 2002
    Location
    Oakland, CA
    Posts
    126
    how do I do that?

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    if cdbl(fix(memvar))=memvar then 'its an integer equivalent
    ' ie notthing tothe right of the decimal point
    'insert code to process integers
    else 'its a real number
    'insert code to process non integers
    endif

Posting Permissions

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