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

 Page 1 of 1 [ 5 post ]

Relevant Pages

Powered by phpBB® Forum Software