-
In C++ there is a ceiling function that allows one to always round a number up. Example: if the number is 11.1 ceiling will round to 12. I know about Round(number,0) and Format(number,"###.") , but these will round a number less that .5 down to the next lowest integer. Is there some sort of ceiling function in VB
------------------
-
Try this code:-
Private Sub rounder(ByVal number As Double)
Dim place As Integer
If InStr(number, ".") <> 0 Then
place = InStr(number, ".")
number = Left(number, place)
number = number + 1
MsgBox number
Else
End If
Glenn Harwood
End Sub
-
Sorry, slight typo...try this
Try this code:-
Private Sub rounder(ByVal number As Double)
Dim place As Integer
If InStr(number, ".") <> 0 Then
place = InStr(number, ".")
number = Left(number, place)
number = number + 1
MsgBox number
Else
End If
End Sub
Glenn Harwood
-
Is it not too much of coding for this?
Why don't you just + 0.5 to the number to be rounded?
Looks shorter