Accurate Timer For Sports


hi all. i'm trying make expression apply text layer time sports videos accurately. far, have minutes , seconds figured out, can't seem milliseconds work. keep adding values past 100 dont want. whenever reaches 100 should start over.

 

milli = math.floor(time*100);

sek = math.floor(time%60);

min = math.floor(time/60);



if(sek<10)

{

   "0" + min +":0" + sek + ":" + milli;

}

else

{

   "0" + min +":" + sek + ":" + milli;

}

try this:

 

milli = "" + math.floor((time%1)*1000);

while (milli.length < 3) milli = "0" + milli;

 

sek = "" + math.floor(time%60);

if (sek.length < 2) sek = "0" + sek;

 

min = "0" + math.floor(time/60);

 

min + ":" + sek + "." + milli

 

dan



More discussions in After Effects Expressions


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support