Results 1 to 4 of 4

Thread: Rounding

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2000
    Posts
    225
    Hiyas,

    How do I round down? I don't want it to round up even if it's above 0.5 - if it's not whole it must be rounded down.

    Thanks.

    -Git

  2. #2
    Addicted Member
    Join Date
    Jul 1999
    Location
    St-Élie d'Orford, Quebec, Canada
    Posts
    133
    I'am sure there is a better way to do this but
    you could try to use the VAL function... It will however
    only recognize the PERIOD (.) as valid decimal separator !

    Hope it helps

  3. #3
    Addicted Member S@NSIS's Avatar
    Join Date
    Aug 2000
    Location
    Stoke-On-Trent, England
    Posts
    243
    Hi,
    Use
    Code:
    a = Fix(a)
    This will remove any fractional part and just return the integer. ie 3.75, 3.4, 3.9999 all become 3

    Hope this helps

    Shaun
    Web/Application Developer
    VB6 Ent (SP5), Win 2000,SQL Server 2000

  4. #4
    Guest
    Use the Int() function
    Code:
    MyNum = 4.52
    MsgBox Int(MyNum)

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