Centering date, battery, etc. readouts inside windows

Hi all,
Noob watch designer here with a noob question :slight_smile:
When I place the steps or heartbeat in boxes/windows the numbers move to one side (off center) when an additional digit is added (when steps go from the hundreds to the thousands or the pulse goes from 99 to 100+). Is there any way to keep the numbers centered in the window?
Thanks!

I would be interested in that too as at the moment I simply left justify everything and then allow the to fill right.

In the creator, when you select a layer item like text you will have three choices to align (left, centered, right) Itā€˜s in the small box below.

2 Likes

I donā€™t know how to right or centre justify text but, if it helps, in a couple of my recent designs I split the date, battery level and steps into separate digits and display those separately exactly where I want them.

For example, steps would be: A B C D , where:

A _ _ _ = (floor(#ZSC#/1000))
_ B _ _ = (floor((#ZSC#%1000)/100))
_ _ C _ = (floor((#ZSC#%100)/10))
_ _ _ D = (#ZSC#%10)

3 Likes

We posted at the same time :slight_smile: - well answered!

1 Like

Awesome thank you

1 Like

Thanks for the responses :slight_smile:
Still trying to figure out whatā€™s going on here as the text layers are all center-justified but theyā€™re ā€˜justifyingā€™ off-center lol.
Must be something wrong with the way I place the actual windows.
mikeoday- thatā€™s excellent and Iā€™m figuring out how to drop the code in now. Thanks!

1 Like

You gotta separate everything out. So the Steps and the text for ā€œstepsā€ should be 2 different layers. Same for digital times and dates etc.

Hereā€™s a trick I use to get stuff to fit based on the MAX size they might get toā€¦

Figure out what that max number is, like steps i think is 4 digits, (the longest month is SEPTEMBER, longest day is WEDNESDAY, etc) so make a type/text layer and type out 4 digits (no 1ā€™s) use 8ā€™s or 0ā€™s, use the same font and use that layer to align the actual steps/day/month/etc text.

Does that make sense?

For example if you want the same amount of space between WEDNESDAY and SEPTEMBER, then align WEDNESDAY right and SEPTEMBER left.

2 Likes

Thanks Rator. Makes sense- giving it a try now.

Nice, good luck!

Just spotted this topic and itā€™s now my lucky day - Iā€™m trying to split the date tag and til now I have failed spectacularly! Iā€™ve tried to find one of your watches in the hope inspection was on but again failed. Would you be so kind and send me a link?

2 Likes

I will jump in . Mike gave the answer in his response .
He is one of those who is always busy . So he might take a while to get back .

For Date tens.
(floor((#Dd#%100)/10))

Date units.
(#Dd#%10)

This gives a Leading Zero . If you donā€™t want that we need a different formula .

If that is you up and running Please credit Mike and this 3 year old topic . Not enough people go back and look at what the Giants were up to all those years ago .

1 Like

Today IS my lucky day - there always seems to be somebody awake and willing to help no matter the time zone! Thanks @russellcresser (and @mikeoday ). Yes - Mike did give the answer indeed, my problem was that I didnā€™t understand what the expressions were doing, specifically the % and floor and well the rest too if Iā€™m honest. I see the logic now and understanding will no doubt come later :slight_smile: So thanks guys. When I publish my watch I will certainly give credit to you both and the community.

2 Likes

Yeah % ( Modulo) is a great piece of magic . It devides a big number and gives just the remainder only . So #Ds#%10 will give you a continuous count 0 to 9 forever . Try with a number like #DNOW# ( Epoch Timer ) . floor , round and ciel do roughly the same job . They get rid of the fraction element of a number ( floating point ) . You know that round will show 2.0 or 2.5 . . floor is used most for us . As long as you understand the logic and know which numbers to change that is the most important thing . I found I got no where till I began to remember some stuff .

1 Like