Different type of seconds

I’m trying to get the leading “0” or “00” on this #Dsm# and can’t figure it out. And this constant jumping back and forth. It’s not the font I am using, same font as the time and that doesn’t jump.

4 Likes

I would split the seconds and the milliseconds to do that.

So the first part in front of the comma is easy, just use #DsZ# and add the dot after that.

For the milliseconds, we can do #Dsm#-#Ds#, but we want a whole number, so multiply that by 1000, we do not want digits after that number, so we need to use the toFixed function and then fill that up with leading 0 using the pad function.

The result is:
#DsZ#.(pad((toFixed(((#Dsm#-#Ds#)*1000),0)),3))

9 Likes

Thank you

4 Likes

My initial function used floor, which is not accurate, better to use toFixed.

5 Likes

I have not saved a snipit of code for a while . Thanks @tom.vannes .

5 Likes

You’re welcome.
Nice design, by the way…

5 Likes

Seems to be working with the floor part. Not jumping back and forth now. Unless I’m seeing wrong.

5 Likes

Thank you kindly

4 Likes

You sir are a WIZARD with expressions.

6 Likes

I put this on the face, and I noticed that the milliseconds changed a bit

3 Likes

Alternatively we could use (my favorite) modulo function and floor, to get rid of the extra digits like this
#DsZ#.(pad(floor(1000*(#Dsm#%1)),3))

btw. I the #Dsm# in creator preview seems still to be broken.

6 Likes

I dont think 1/100 and 1/000 run properly I have made movie of them but at 30FPS we don’t get much decent feedback . I would never show the third digit . It is irrelevent really unless you are timing high speed effects . When I was doing that we worked to 1/100s . Even then if someone opened a door everthing changed .

4 Likes