• Rounding Formula needed

    Author
    Topic
    #460825

    Hi,

    I need to round a number and am not sure what to use for the formula. No matter what the number equals I need it to drop any numbers after the decimal without rounding up. So, if the number = 444.9, the result should be 444. If I use the formula round([number],2) it goes to 445. I need it to be 444.
    Thanks,
    Leesha

    Viewing 1 reply thread
    Author
    Replies
    • #1166718

      You need either the Int function or the Fix function.

      This is from Help and explains he difference between them.
      Both Int and Fix remove the fractional part of number and return the resulting integer value.

      The difference between Int and Fix is that if number is negative, Int returns the first negative integer less than or equal to number, whereas Fix returns the first negative integer greater than or equal to number. For example, Int converts -8.4 to -9, and Fix converts -8.4 to -8.

    • #1166747

      Hi John,

      Thanks for the info. I’ve never used either of these and when I type in “int function” or “fix function” in access help the only thing that comes up with references to sql. I didn’t see examples of how to use either of these functions in a query. Is this even possible?

      Thanks,
      Leesha

      • #1166751

        Int and Fix are VBA functions, so if you want to look them up, you should do so from the Visual Basic Editor.
        Like most VBA functions, they can be used in queries and in expressions, for example like this:

        Amount: Int([UnitPrice]*[Quantity])

        • #1166762

          Thanks Hans! That worked great and the info helped me to “see” it and understand it.

          Leesha

    Viewing 1 reply thread
    Reply To: Rounding Formula needed

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: