What code should be used to shorten the display Circle Progress

I am using the code * ((#ZSC#*0.288)/10000) * to shorten the Circle Progress, when the steps exceed 10k… it jumps out of the frame… is there any code to prevent the progress from moving too much?

2 Likes

You can use clamp to limit the progress:

For example, circular progress with 10000 steps, but I want those to be within 180°, so half, then:

(clamp(#ZSC#, 0, 10000)/20000)

Your formula would make sense if you want to stretch a rectangle or change the fill ratio of an Arc.

4 Likes

My design is a quarter circle.would that fit?

2 Likes

I do not think so, but difficult to tell what you are trying to achieve. If you want, share the link and open up inspection of your draft watch face, then it would be easier to help.

But 1/4 circular progress, then

(clamp(#ZSC#, 0, 10000)/40000)

2 Likes

I made the bar on the right black, when it passes 10,000, it pops out… it can be seen when it is synced to the clock… Of course, I will hide it under other layers until the next bar, but it is not good

1 Like

As Tom already wrote, you can leave everything that works for you and clamp just the input like this
((clamp(#ZSC#,0,10000)*0.288)/10000)
I don’t know why you have the 0.288 there, for a quarter circle I would expect 0.25
Maybe it is not exact quarter…

2 Likes

Thank you… yes it is not exact

This code is perfect…


The gray bar on the right did not exceed 10000 steps. :star_struck: :clap:

1 Like

Well done! looking good…

1 Like

Thank you too :clap: :100: