|
-
Sep 5th, 2001, 08:40 AM
#3
Try this function:
Private Function Round(nValue As Double, nDigits As Integer) As Double
Round = Int(nValue * (10 ^ nDigits) + 0.5) / (10 ^ nDigits)
End Function
To round 4.48 to 4.5, you would say:
MsgBox Round(4.48, 1)
The 1 signifies the number of digits after the decimal point to carry out the rounding.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|