Try this function. It will take any number with a decimal after it, truncate it, and add one
Public Shared Function roundUp(ByVal iNum As String) As Integer
If Not IsDBNull(iNum) Then
Dim sStr As String = iNum
If InStr(sStr, ".") > 0 Then
Return CInt(Left(iNum, InStr(sStr, ".") - 1)) + 1
Else
Return iNum
End If
Else
Return 0
End If
End Function
mark
|