Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

I need to build an expression in Access 2000 which rounds up

Discussion in 'Information Technology' started by Danita, Jul 28, 2006.

  1. Danita

    Danita
    Expand Collapse
    Guest

    I am building text boxes in a form which reference other fields and I need
    the text boxes to roundup to the nearest dollar.
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News WWI Sikh Heroes Need To Be Remembered: Dr Atamjit Breaking News Sep 11, 2016
    Interracial And Interfaith Marriage, Help Needed To Confront/convince My Parents Love & Marriage Aug 16, 2016
    Sikh News Sikh Seva Volunteers Keep The Food Service Drive For The Needy Going After Passing Away Of Breaking News Jul 29, 2016
    Need some info regarding bibek wrt eating Sikh Rehat Maryada Jan 14, 2016
    Spiritual Why We Only Need To Pray For Naam Blogs Dec 20, 2015

  3. Ofer Cohen

    Ofer Cohen
    Expand Collapse
    Guest

    You can use the round function

    =Round([FieldName])

    To always round down
    =Int([FieldName])

    To always round up
    =Int([FieldName]) + 1

    --
    Good Luck
    BS"D


    "Danita" wrote:

    > I am building text boxes in a form which reference other fields and I need
    > the text boxes to roundup to the nearest dollar.
     
  4. Ofer Cohen

    Ofer Cohen
    Expand Collapse
    Guest

    Sorry Danita
    Don't use the last example of rounding always up, I didn't consider a full
    number, that will take it up by 1

    --
    Good Luck
    BS"D


    "Danita" wrote:

    > I am building text boxes in a form which reference other fields and I need
    > the text boxes to roundup to the nearest dollar.
     
  5. Danita

    Danita
    Expand Collapse
    Guest

    Okay let me type an example:

    This is what my original field looks like:
    =[Standard]*.6

    =Round([Standard]*.06)
    Does that look right??

    "Ofer Cohen" wrote:

    > Sorry Danita
    > Don't use the last example of rounding always up, I didn't consider a full
    > number, that will take it up by 1
    >
    > --
    > Good Luck
    > BS"D
    >
    >
    > "Danita" wrote:
    >
    > > I am building text boxes in a form which reference other fields and I need
    > > the text boxes to roundup to the nearest dollar.
     
  6. Ofer Cohen

    Ofer Cohen
    Expand Collapse
    Guest

    If that the original

    =[Standard]*.6

    Then use
    =Round([Standard]*.6)

    --
    Good Luck
    BS"D


    "Danita" wrote:

    > Okay let me type an example:
    >
    > This is what my original field looks like:
    > =[Standard]*.6
    >
    > =Round([Standard]*.06)
    > Does that look right??
    >
    > "Ofer Cohen" wrote:
    >
    > > Sorry Danita
    > > Don't use the last example of rounding always up, I didn't consider a full
    > > number, that will take it up by 1
    > >
    > > --
    > > Good Luck
    > > BS"D
    > >
    > >
    > > "Danita" wrote:
    > >
    > > > I am building text boxes in a form which reference other fields and I need
    > > > the text boxes to roundup to the nearest dollar.
     
  7. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    +0.9999999999
    would not

    Pieter

    "Ofer Cohen" <OferCohen@discussions.microsoft.com> wrote in message
    news:85D8A3E4-2CC8-40D9-AB5B-CCBE75469D81@microsoft.com...
    > Sorry Danita
    > Don't use the last example of rounding always up, I didn't consider a full
    > number, that will take it up by 1
    >
    > --
    > Good Luck
    > BS"D
    >
    >
    > "Danita" wrote:
    >
    >> I am building text boxes in a form which reference other fields and I
    >> need
    >> the text boxes to roundup to the nearest dollar.
     
  8. Rick Wannall

    Rick Wannall
    Expand Collapse
    Guest

    Sample for you:

    Public Function testround(var As Variant) As Long

    Dim d As Double

    If IsNull(var) = True Then
    testround = var
    Exit Function
    End If
    testround = Int(CDbl(var) + 0.5)

    End Function

    It's converting the received value explicitly to a double (getting in the
    habit for .NET conversion), adds 1/2, then takes the integer portion of the
    result.
     

Share This Page