Questions about adding and subtracting 1 from minute value

I want to have the minutes and above that I want minutes minus 1 and below that minutes plus 1.

Question time:

So #DmZ# is minutes with leading zero. how do I do (#DmZ#+1) but instead of it saying 60 say 0 and the same with instead of -1 say 00.

Also (#DmZ#+1) and (#DmZ#-1) drop the leading zero.


Ok so I figured out half of it with conditionals

$#DmZ#==00?59:(#DmZ#-1)$ shows 59 or the right number
$#DmZ#==59?00:(#DmZ#+1)$ show 0 or the right number

however both still drop the leading 0

As far as I can see, #DmZ# is Minutes With Leading 0, and #Dm# is just Minutes
Hope this helps you out dragon2777 :sunglasses:

I understand that but if you do (#DmZ#-1) it show 6 not 06. It drops the leading zero

I can’t explain that sorry, I don’t know the Math side of things too well :thinking:

@dragon2777 #DmZ# is display only and doesn’t really work with conditionals. I’m sure there’s a more elegant way of achieving this but if you have a layer with:

Text: $#Dm#<11?(0)(#Dm#-1):(#Dm#-1)$
Opacity: $#Dm#=0?0:100$

And another layer in the same location with:

Text: 59
Opacity: $#Dm#=0?100:0$

It should work for your “previous minute”.

1 Like

Thanks for your help @pandaKrusher :+1:

Thanks for the info on display vs math. I’m not paying for pro so I don’t think I have layers (not home can’t check) however you did give me an idea using opacity. Right align the minutes and just put a 0 next to it and set opacity ok the 0 for less than or greater than 10. Even though I may not be able to use your idea thanks for the idea you gave me

You absolutely have layers. Everybody does. It’s the column of Elements on the left-hand side of your editor.

1 Like

for whatever reason I was thinking of themes. I assume what you say layer you just mean another text box. Thanks again

I’m not really any good at writing elaborate math coding for my watch faces. I pick up a lot of what I need here on the forum. The rest of it I just make a guess and try to figure out a way to make it work. That includes guessing at code or just using opacity to show and hide what needs to be shown and hidden. That is what I have done in this watch face. MAG 1003 Inspection is open on this and you can see exactly how I did and redneck engineered the rest. :laughing: Use what you need or ignore it all, the choice is yours.

1 Like

While it works in the editor, the element “00 Min Only” does not appear on my device when #DmZ#=0. I suspect this is because some watches can’t handle #DmZ# conditionals well.

1 Like

Yeah some it doesn’t work. Having it in the face doesn’t break it so I would rather code for it and have it work most of the time and when it doesn’t just show 0

1 Like

Thanks will take a look at that