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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rounding 1

Status
Not open for further replies.

Pitchfork

Programmer
Apr 15, 1999
2
0
0
GB
Hi<br>
How can I round a number up to the next whole number?<br>

 
Look at Access, Office VB issue 9902. Editor Ken Getz (co-author of The Access XX Handboook series) gives a great rounding routine. This mag is a great reference for dev tips and is well worth the $$.
 
SUB UpTrunc(x As double)<br>
Dim result As long<br>
result = Int(x) 'I believe it's Int, otherwise try Trunc<br>
If result&lt;&gt;x Then result = result + 1<br>
UpTrunc = result<br>
END SUB
 
how about adding .5 and then assigning to an INT or using INT function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top