Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: rounding up

  1. #1
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts

    rounding up

    is there any way to round UP (fix and int round down) that isnt just 1 of fix+1, int+1 or round+0.5 because they all return 1 for 0, 2 for 1 etc i think round+0.4999999 pay work but i dont know and if there is a better ceiling function i would prefer to use that

  • #2
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    i suppose i could do
    Code:
    if int(number) <> number then number = int(number)+1
    and take the variable called number out of that

  • #3
    New to the CF scene
    Join Date
    Mar 2004
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Same thing but in a function....

    Code:
    Function Ceil(n)
      If (n = Int(n)) Then
        Ceil = n
      Else
        Ceil = Int(n+1)
      End If
    End Function
    For Seeeecret Eating


  •  

    Posting Permissions

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