|
-
Jan 17th, 2000, 06:50 AM
#1
Thread Starter
Junior Member
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
------------------
-
Jan 17th, 2000, 07:12 AM
#2
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
-
Jan 17th, 2000, 07:14 AM
#3
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
-
Jan 17th, 2000, 07:40 AM
#4
Hyperactive Member
Is it not too much of coding for this?
Why don't you just + 0.5 to the number to be rounded?
Looks shorter
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|