Timing and stuff. 
Author Message
 Timing and stuff.

i just want to say first.. thanks to any help and replies..

Now the problem i have may me quite simple but i am real dumb at maths
and i can not figure this out...
Does anyone know how i can get the secounds of a movie duration... say
400 secounds  and turn it into min and sec.. so it would be something
like 4:34.

--
Posted via Mailgate.ORG Server - http://www.*-*-*.com/



Sat, 06 Nov 2004 16:34:47 GMT  
 Timing and stuff.
Try:
-------------
dim totalsecs, mins, secs as integer
dim show as string
totalsecs = 400
mins = floor(totalsecs/60)
secs = totalsecs - mins
show = str(mins)+":"+secs
// If you want to show it in, e.g., editfield1 add
editfield1.text = show
---------------
I hope it works.
Boris
Quote:
> Does anyone know how i can get the secounds of a movie duration... say
> 400 secounds  and turn it into min and sec.. so it would be something
> like 4:34.



Sat, 06 Nov 2004 17:43:17 GMT  
 Timing and stuff.

Quote:

>Try:
>-------------
>dim totalsecs, mins, secs as integer
>dim show as string
>totalsecs = 400
>mins = floor(totalsecs/60)
>secs = totalsecs - mins
>show = str(mins)+":"+secs
>// If you want to show it in, e.g., editfield1 add
>editfield1.text = show
>---------------

I think you forgot one thing. :) The "secs" assignment should be:

   secs = totalsecs - (mins * 60)

Or you could do this:

  secs = totalsecs MOD 60

Also, you might want to make sure that the seconds are always two digits.
Here's one way:

  If secs < 10 Then
     show = Str(mins) + ":0" + Str(secs)
  Else
     show = Str(mins) + ":" + Str(secs)
  End If

Regards,

 - Jeff



Sat, 06 Nov 2004 20:48:31 GMT  
 Timing and stuff.
In article


Quote:
> Does anyone know how i can get the secounds of a movie duration... say
> 400 secounds  and turn it into min and sec.. so it would be something
> like 4:34.

minutes=totalseconds\60
seconds=totalseconds mod 60

output=Str(minutes)+":"+format(seconds,"00")

should work

--
V.I.R.U.S.



Sat, 06 Nov 2004 23:35:24 GMT  
 Timing and stuff.

Quote:

> minutes=totalseconds\60
> seconds=totalseconds mod 60

> output=Str(minutes)+":"+format(seconds,"00")

> should work

Thanks a lot.... it worked perfect

--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG



Sun, 07 Nov 2004 12:07:07 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Porting Date Time C stuff to ISE Eiffel

2. Win9x and [after] or any time related stuff

3. How can I ask LV to leave my design time stuff separate from runtime stuff

4. HELP! Where to go for info on FPU instructons, timings and stuff like that...

5. FS/A: Cool rare SMALLTALK stuff, don't miss out, NeXT and BeOS stuff too

6. JSObject stuff & stuff

7. Latest Fortran stuff and other stuff

8. Bug in time.c (was Time.times problems)

9. time and scheduling (was: bug report: [ #447945 ] time.time() is not non-decreasing)

10. time zones, daylight saving time, and universal time

11. Manugistics run-time [was: STSC run-time]

12. GMT time vs. local time

 

 
Powered by phpBB® Forum Software