I got a problem regarding the integer part and decimal part of a number. Actually what I need is say I have a number ‘101’. this is actually came after some calculations and its time. I need to find the hrs and min. So what I did is
overtime = 101
Dim fraction As Decimal = 0
If overtime > 59 Then
fraction = overtime / 60
'overtime = overtime / 60
fraction = fraction - CInt(fraction)
fraction = fraction * 60
Dim str() As String = Split(fraction.ToString, ".")
Try
If str(2).Length > 2 Then
End If
Catch ex As Exception
End Try
End If
but the integer is getting rounded so that I get the wrong answer.
Look at the
\operator (opposite direction slash from the normal division operator), which automatically truncates off the decimal portion leaving only an integer, and theModoperator, which returns only the remainder of a division operation.