mbentley Registered User. Local time Today, 09:36 Joined Feb 1, 2002 Messages 138 Jul 24, 2002 #1 Can anyone tell me how to round down (in this case to 1 decimal place). I need something like the rounddown function in excel.
Can anyone tell me how to round down (in this case to 1 decimal place). I need something like the rounddown function in excel.
A Alexandre Registered User. Local time Today, 23:36 Joined Feb 22, 2001 Messages 791 Jul 24, 2002 #2 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
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