Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rounding to the nearest 10,000

Status
Not open for further replies.

tallguy804

IS-IT--Management
Apr 15, 2004
25
US
Ok here is my problem. I have a field in a data base that holds numbers such as 78565.25 and I need to be able to round that number to the nearest 10,000. So the number needs to return 79000.00 and for the life of me I can not figure out how to do it.

Thanks in advance for your help
 
You might try something like the following:

Dim num As Double
Dim rounded As Long

num = 78565.25
rounded = CLng(CDbl((num / 1000) + 0.5)) * 1000


Good Luck
--------------
To get the most from your Tek-Tips experience, please read FAQ181-2886
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top