I am trying to calculate a time to be displayed in a label (Minutes & Seconds) from a given # of seconds. So, if the seconds returned is 125, I want the label to read 2:05.
I'm having a hard time due to integer rounding. Below is what I have right now:
s_timemn = lDuration / 60
s_timesec = lDuration - (s_encodetimemn * 60)
s_time = s_timemn & ":" & s_timesec
lbl_time.Text = s_time
The problem with this is that if the given seconds is 31 seconds, the label will display "1:-29" instead of "0:31". I've played with several things, but can't get a good version. Any ideas?
Thanks
I'm having a hard time due to integer rounding. Below is what I have right now:
s_timemn = lDuration / 60
s_timesec = lDuration - (s_encodetimemn * 60)
s_time = s_timemn & ":" & s_timesec
lbl_time.Text = s_time
The problem with this is that if the given seconds is 31 seconds, the label will display "1:-29" instead of "0:31". I've played with several things, but can't get a good version. Any ideas?
Thanks