Round Down to one decimal

mbentley

Registered User.
Local time
Today, 09:36
Joined
Feb 1, 2002
Messages
138
Can anyone tell me how to round down (in this case to 1 decimal place). I need something like the rounddown function in excel.
 
Try:
Code:
Function RoundN(x, N As Integer)
'
' Rounds a number to N decimal places
' Uses arithmatic rounding
' N should be in the range 0-10 for proper results
'
Dim Factor As Long
Factor = 10 ^ N
RoundN = Int(x * Factor) / Factor
End Function
 

Users who are viewing this thread

Back
Top Bottom