Place Value Tag Expression?

Can tag expression determines the value of each place value?

For example,
if Tens placement value is 8, then opacity 100.
if Hundreds placement value is 3, then opacity 0

GWS has no way to determine what the value is, if it is text input and not a number. You could do something like that with a “counter” app using Tizen Studio.
It it is something that GWS has a tag fuse modulo % operator. For example for step count digits (([sc]%10) * 10) +10 for units ((([sc]%100) % 10) * 10) +10 for tens and so on

Samsung Developer Program
Samsung Developer Program

1 Like

It can determine values on the places of tag value.
for the units its easy ([kcal]%10==6)*100
for tens its harder (([kcal]%100-[kcal]%10)/10==8)*100
for hundreds its alike, I guess you can continue.

1 Like

Thanks Ron, modulo operator is one of those that my brain still doesn’t get it. Even though I understand what it does, but I still don’t fully understand why it works haha.

You’re a wizard! Peter. Honestly I don’t know why it works, but it works fantastically! If you have free time, I would appreciate it if you can explain it in plain English.

Place Value Plain English Tag Expression
Units/Ones Show image if Ones is 6 ([sc]%10==6)*100
Tens Show image if Tens is 2 (([sc]%100-[sc]%10)/10==2)*100
Hundreds Show image if Hundreds is 7 (([sc]%1000-[sc]%100)/100==7)*100
Thousands Show image if Thousands is 8 (([sc]%10000-[sc]%1000)/1000==8)*100
Ten Thousands Show image if Ten Thousands is 5 (([sc]%100000-[sc]%10000)/10000==5)*100

This can be a workaround for text on curved/circular path, potentially. Downside is you would need to use 10 bitmap font images and their tag expression for each place value. For step counts that goes to ten thousands, it would use 50 of them. I wonder if that will cause lag or battery drain.

It would be 10 times easier to make a circular text workaround if we were allowed to display result of tag expressions directly in text field.
In plain english remember when you learned division of numbers before you learned decimals. There was a/b meaning how many times the whole b can be subtracted from a and how much reminds of it after that. This reminder is what [tag]%x gives, like no mater how many times you can subtract whole x from the tag, main thing is what reminds after that.
Thanks for the praise, but I feel more and more bitter, about being unworthy to be allowed to publish one or two watchfaces.

1 Like

That would be great!

Thanks for the plain English explanation. I’ll need more time to train my left brain about this.

What do you mean?