by Dr. John Nyhart (4 Submissions)
Category: Math/Dates
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Originally Published: Tue 6th June 2000
Date Added: Mon 8th February 2021
Rating:
(1 Votes)
This function rounds up and down in any step that you choose.
' ***********************
' Mode Process
' ---- -------
' UP RoundUp
' DN RoundDN
' ***********************
Select Case UCase(Mode)
Case "DN"
doRound = (Int(Value / RStep) * RStep)
Case "UP"
If Value Mod RStep > 0 Then
doRound = ((Int(Value / RStep) * RStep) + RStep)
Else
doRound = Value
End If '»If Value Mod RStep > 0 Then
End Select '»Select Case UCase(Mode)
End Function