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 / Database Design / April 2005

Tip: Looking for answers? Try searching our database.

Rounding numbers

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
iksingh - 23 Apr 2005 15:19 GMT
hi

can someone help me to round numbers up or down, so if a number is 9.
it would go to 9.5 and if a number is 7.8 it will go to 8

any help would be greatly appreciated

thank

--
iksing
Ken Snell [MVP] - 23 Apr 2005 17:13 GMT
What if the number is 9.2? Does it go to 9.5? or to 9.0?

Give us more info about exactly what the rounding is supposed to do.

Signature

       Ken Snell
<MS ACCESS MVP>

> hi
>
[quoted text clipped - 4 lines]
>
> thanks
iksingh - 23 Apr 2005 18:32 GMT
hi

thanks for responding, if the number is
9.2 id like it to turn into 9
9.4 into 9.5
9.6 into 10

so the number is an integer or its 5.5 or 6.5
and so on

thank

--
iksing
Ken Snell [MVP] - 23 Apr 2005 19:21 GMT
Your rounding logic is not consistent.

9.2 goes to 9

but 9.6 goes to 10?

Are you sure of this? What is the logic to round down 9.2 and round up 9.6?

Signature

       Ken Snell
<MS ACCESS MVP>

> hi
>
[quoted text clipped - 7 lines]
>
> thanks
iksingh - 24 Apr 2005 10:41 GMT
im sorry

i think im a bit confused i have to have a field in which a weight i
put to the nearest 0.5 of a kilogram, a combo or list box has to man
value so its not convienient so i have to format the field so that if
acustomer puts in

8.1 rounds to 8
8.2 rounds to 8
8.3 rounds to 8.5
8.4 rounds to 8.5
8.5 its ok
8.6 rounds to 8.5
8.7 rounds up to 9
8.8 rounds up to 9
8.9 rounds up tp 9

does this seem correct

thanks again for you time and hel

--
iksing
Tim Ferguson - 24 Apr 2005 15:24 GMT
>  i have to have a field in which a weight is
> put to the nearest 0.5 of a kilogram,

 = IIf(Int(dblWeight*2)=0, dblWeight, Int(dblWeight * 2 + 0.5) * 0.5)

Hope that helps

Tim F
Wayne Phillips - 24 Apr 2005 16:20 GMT
Your logic is still inconsistant.

Why would 8.7 round up to 9???  Surely you mean round down to 8.5

Regards,

Wayne Phillips
http://www.everythingaccess.com - Access Database Repair Service

> im sorry
>
[quoted text clipped - 16 lines]
>
> thanks again for you time and help
 
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.