Stopwatch - adding leading zeros to H,M,S times

The Chrono function uses #SWEH# #SWEM# #SWES# for Hours, Minutes and Seconds in the timer display. Is there a way to add leading zeros so you get a “00:00:00” kind of display?

The function I want to add this to is shown below (unless there is a better way of doing this):
(floor(#SWEH#%60)):(floor(#SWEM#%60)):(floor(#SWES#%60))

Any suggestions would be greatly appreciated.

$(floor(#SWES#%60))>9?(floor(#SWES#%60)):0(floor(#SWES#%60))$

1 Like

Sorry, but I plugged that in and it didn’t work. Did you try it out at your end and got it to work?


You have to click in the middle of a watch face to start the chronometer.

You have duplicated the post, perhaps it is better to remove it.

Thank you very much for trying to help with this, but you can see from your own screenshot that this isn’t working. It should be displaying “00:00:00” on the watch face, and then when you start the chrono. the timer would start showing elapsed time.

You can also see that your formula gets to 60 seconds and then just restarts at zero. My post requested an H:M:S timer and not just seconds.

I think I see now that if I string the formulas together using H and then M and then S using your formula it should work. Something like this:
$(floor(#SWEH#%60))>9?(floor(#SWEH#%60)):0(floor(#SWEH#%60))$:$(floor(#SWEM#%60))>9?(floor(#SWEM#%60)):0(floor(#SWEM#%60))$:$(floor(#SWES#%60))>9?(floor(#SWES#%60)):0(floor(#SWES#%60))$

I’ll try that out.

Nope. That didn’t work. I’m new to using this kind of coding and don’t know how to string the expressions together

Are you sure this is not working? Then look at the corrected watch face upstairs. For some reason, I thought that you would have done the rest by yourself :slightly_smiling_face:

I had a “duh” moment in not figuring this out. I just placed three separate elements, one with #SWEH#, one with #SWEM# and one with #SWES#, each separated by a colon and it worked fine.

Thank you very much for helping me solve this.

1 Like

I’ve only been using Facer Creator Pro for three days, but soon hit the same problem of no leading zeroes in the standard #SWEH# #SWEM# #SWES# coding for a stopwatch digital timer. When I first read this thread, I didn’t pick up exactly what Richard meant by ‘separate elements’ in his last post.

Just in case any other confused newbie visits this thread, what Richard meant was that you need to add three separate Digital Timer elements to the watch face. In my case, I also wanted milliseconds, so I added four Digital Timer elements, with coding as shown below.

Note that I removed the Modulo operator from the Hour timer, as I don’t think it performs a useful purpose and I assume it would generate the wrong value when it runs over 60 hours. Please correct me if I am wrong in this assumption!!

Hours Dig Timer: $(floor(#SWEH#))>9?(floor(#SWEH#)):0(floor(#SWEH#))$:

Mins Dig Timer: $(floor(#SWEM#%60))>9?(floor(#SWEM#%60)):0(floor(#SWEM#%60))$:

Secs Dig Timer: $(floor(#SWES#%60))>9?(floor(#SWES#%60)):0(floor(#SWES#%60))$:

Millisecs Dig Timer: $(floor(#SWEMS#%60))>9?(floor(#SWEMS#%60)):0(floor(#SWEMS#%60))$

1 Like