Results 1 to 4 of 4

Thread: trouble with integer

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2000
    Posts
    23

    Angry

    Hi everybody
    I am trying to assign the result of a calculation to be returned as an integer but the result puts loads of decimal places that I dont want can anyone tell me where I,m going wrong
    Thanks

  2. #2
    Fanatic Member Gaffer's Avatar
    Join Date
    Nov 2000
    Location
    London
    Posts
    828
    the function to use is Round:

    i.e.

    Code:
    Msgbox Round(2.888)
    gives the result 3.

    Be careful if you use Int. It takes the integer position only, thus Int(2.888) returns 2

    Hope this helps

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Oct 2000
    Posts
    23

    Question re round

    Hi
    Thanks for the reply.i've put the number as single but it still rounds down. could the problem be that i'm obtaining the value with a calculation using integers??
    Thanks!

  4. #4
    Guest
    Try, CInt.
    Code:
    MyValue = CInt(MyValue)

Posting Permissions

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



Click Here to Expand Forum to Full Width