Rotational TAG for phone battery integer #PBN#

Would love a little help here. I cannot seem to figure out this phone battery dial. The watch battery dial seems to work perfectly fine.

Code i’m using for the watch battery:
((#BLN#*1.2)-60)

Code I’m using for the phone battery:
((#PBP#*1.2)-60)

The png i’m using for the needle has the needle set at 9oclock, which is why the weird numbers. Sloppy, I know. Still new to this.

I tried some of the code samples in this thread, but nothing seemed to work and i couldn’t figure out how to adjust start position (i know i know. total newb. I push pixels around all day—i’m not used to this pushing numbers thing).

Any help would be greatly appreciated.

1 Like

Step 1:

If using #BLN# (integer value, for watch), then use #PBN# for phone …


Then try:

$#BLN#>2?(ceil(#BLN#*1.2)-60):2-60$

2 Likes

man, thank you so much for that!
Like you suggested, i switched it to $#PBN#>2?(ceil(#PBN#*1.2)-60):2-60$

A couple of quick questions:

  • The dial is at least moving now, which is great, but I can’t seem to rotate the starting point. I assumed changing the two instances of “60” to other numbers would move it around, but nothing seems to change. I’m sorry if this is basic stuff, I’m still trying to learn and have no coding background and haven’t used basic algebra since high school… Trying to learn though and I appreciate the help so much!
  • what do the “$” do in this code?

Thanks again so much. You guys are like wizards to me with some of the stuff you do.

The $ is for conditional, ? Is what happens if condition is true and : is the else, if condition is false…

1 Like

AMAZING. thank you, i think i’m figuring this out. Thank you so much for the help.

And it works! Cheers all.

3 Likes