Results 1 to 2 of 2
  1. #1
    Lounger
    Join Date
    Apr 2002
    Location
    Burlington, Washington, USA
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Rounding Up (2000)

    Hello,
    I am looking for a function that can be used in Access to round up a number to the nearest 10th, simular to the roundup function used in Excel. For example, I want to round up 730.56 to 740 or 739.26 to 740. Does anyone know where I can find a function or code to allow this to happen?

    Thanks,
    Larry

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Rounding Up (2000)

    In an expression:

    =-Int(-[FieldName] / 10) * 10

    As a function:

    Public Function RoundUp(a, n)
    Roundup = -Int(-a / n) * n
    End Function

    or if you're only interested in rounding up to multiples of 10:

    Public Function RoundUp(a)
    Roundup = -Int(-a / 10) * 10
    End Function

Posting Permissions

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