Make icon disappear

Hi everyone. I’m using [BATT_PER]>=76?-100:0 as an example to show battery icons in 25% stages. My problem is making the higher level icons disappear as the low level icons appear. How can I make 100% battery level icons disappear when 75% shows?

1 Like

@AbsoluteZero

Remove the 100 default setting first don’t minus 100
[BATT_PER]>=76? 100:0
Boolean math both items have to be true for the 100 to show for the others
(([BATT_PER]>=51) * ( [BATT_PER]<=75 ))? 100 : 0

Ron
Samsung Developer Relations

2 Likes

Nice Tutorial Ron . I think it a good idea to point ot the * in the middle of the conditional is Boolean AND when it is needed + is OR . On another platform it is && or || .

My bad, I meant binary math not Boolean there are slight differences. In binary math any number (other than zero) plus zero is true (1) and any number times zero is false (0).

Ron
Samsung Developer Relations.

1 Like

Sorry I do not understand that at all . I thought * was AND .

IF W>X is TRUE AND Y<Z is TRUE then Do something ELSE Do different .

Your logic is correct the asterisk is AND I just get a bit pedantic :slight_smile:

Ron
Samsung Developer Relations

1 Like