Another (very easy) Rounding Function
This code makes easy work of doing simple rounding on decimal number...something that VB currently lacks. Why didn't they think of this?
Inputs
Number (double data type)
Returns
RoundNum (Integer)
Side Effects
Rounding financial stuff is not cool :)
Rate Another (very easy) Rounding Function
(6(6 Vote))
' Paste this code directly into your IDE. This has not yet been tested on VBScript, but should work if you drop the type declarations.
Function RoundNum(Number As Double) As Integer
If Int(Number + 0.5) > Int(Number) Then
RoundNum = Int(Number) + 1
Else
RoundNum = Int(Number)
End If
End Function
Another (very easy) Rounding Function Comments
No comments yet — be the first to post one!
Post a Comment