Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / February 2008

Tip: Looking for answers? Try searching our database.

Round Up in Forms and Reports

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mattc66 - 22 Feb 2008 22:46 GMT
I need to round up on my forms and reports.

Example 20.635 needs to be 20.64

301.125 round up to 301.13.

What do I need in my formula?

Matt

Signature

Matt Campbell
mattc (at) saunatec [dot] com

John W. Vinson - 23 Feb 2008 02:52 GMT
>I need to round up on my forms and reports.
>
[quoted text clipped - 5 lines]
>
>Matt

There's a sneaky trick for rounding up: use the Int() function which rounds
down, but do it on the negative of the number. That is, Int(3.5) rounds to 3,
but Int(-3.5) rounds to -4.

To round up to the nearest two decimals, use

-Int(-100 * [field]) / 100.

This will take 20.635 and change it to -2063.5; The Int will take that to
-2064; dividing by 100 and negating will take it to the desired 20.64.
Signature

            John W. Vinson [MVP]

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.