VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This function rounds up and down in any step that you choose.

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.

Rate 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


Download this snippet    Add to My Saved Code

This function rounds up and down in any step that you choose. Comments

No comments have been posted about This function rounds up and down in any step that you choose.. Why not be the first to post a comment about This function rounds up and down in any step that you choose..

Post your comment

Subject:
Message:
0/1000 characters