Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27101

VS 2008 [RESOLVED] Convert minutes to hour ( round of minutes portion )

$
0
0
i am converting the minutes to hours & minutes
for example 1439 minutes = 24:59

i need to round of the minutes to 60 and then add it to hours if the minute is more
than or equal to 60 and than show the minutes portion , i am little tired & confused any help please



my code is as fallows
Code:

Public Function HourConverter(ByVal Ip_value As Single) As String

        '' converts the ip value to hours
        ''  < XML ERR LOG Or Ip_value = "" >

        Dim Op As String
        Dim hrval As Int16 = Int(Ip_value / 60)
        Dim Modval As Single = Ip_value Mod 60

        If IsDBNull(Ip_value) Or Ip_value = Nothing Then
            Ip_value = 0
        End If

        Op = hrval & "." & Modval

        Return Op

    End Function


Viewing all articles
Browse latest Browse all 27101

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>