I usually have this nice way in Excel to convert normal number format to hour and minutes format using simple cell custom formatting [HH]:mm which turns out like this:
Now I can't seem to find a similar to do this in visual basic 2010 or in sql 2000 so does any one know of a way to do it. Thanks in advance.
Note: the brackets in [ HH ]:mm are to keep the hours figure from rounding to 0 after every 24 hour lap.
Try this:
Public Function FormatHoursAndMinutes(totalMinutes As Integer) As String
Dim span As TimeSpan = TimeSpan.FromMinutes(totalMinutes)
Return String.Format("{0:00}:{1:00}", CInt(Math.Floor(span.TotalHours)), span.Minutes)
End Function