|
|
This function was suggested by an UtterAccess discussion. The original poster needed to round values up to the next 5/100ths (.05). RoundToNext is a generic function that rounds the value argument to the next rounding factor level. So, a call to RoundToNext(105.241, .04) returns 105.28. The call roundtonext(105.241,.05) returns 105.25. CODE Public Function RoundToNext(ByVal rdblValue As Double, _
Optional rdblFactor As Double = 1) ' Procedure: RoundToNext ' ' Code courtesy of UtterAccess Wiki ' http://www.utteraccess.com/wiki/index.php/Category:FunctionLibrary ' ' You are free to use this code in any application, ' provided this notice is left unchanged. ' ' REV DATE DESCRIPTION ' 1.0 2011-07-23 initial release Const cstrProcedure = "RoundToNext" RoundToNext = -Int(-rdblValue / rdblFactor) * rdblFactor End Function
|
| This page was last modified 07:27, 25 July 2011. This page has been accessed 272 times. Disclaimers |