TAG Expressions Progress KM/Mile/KCAL Help Please

Hi looking for some guidance on using custom tags like KM/Miles/Kcal for progress 0-100% on custom image rotation.

For example im using steps and battery with no issues like below for my custom progress images.

Rotation field I set to 180

Tag = [SC_PER]*(-180/100)

Rotation field I set to 180
Tag = -[BATT_PER]*(-180/100)

So for the formulas below how would I make this rotate based on % like im doing for batt/steps please.
So my images are 180 and need to rotate -180, I have tried adding *(180/100) at the end does not work.

KM - [SC] STEPS | ((([SC]*0.745)-([SC]*0.745)%1000)/1000% 100 ).((([SC]*0.745)%1000-([SC]*0.745)%100)/100)((([SC]*0.745)%100-([SC]*0.745)%10)/10)

MILES - (([SC]*0.00475)*1%1>=0.5?([SC]*0.000475)+0.1-([SC]*0.00475)*1%1/10:([SC]*0.000475)-([SC]*0.00475)*1%1/10)

KCAL - (([SC]*0.044)%1>0.5?([SC]*0.044)+1-([SC]*0.044)%1:([SC]*0.044)-([SC]*0.044)%1)

2 Likes

If i use it does work but its matching the steps%

-(([SC]*0.044)%1>0.5?([SC]*0.044)+1-([SC]*0.044)%1:([SC]*0.044)-([SC]*0.044)%1)*0.41

1 Like

Hello,
sorry, but I do not understand what are you trying to do. Why would you expect to have different % of the distance or miles if you calculate them from steps?
the formula is easy: [tag curent value]/[tag goal]*rotation range in degrees
P.S.: [SC_PER]=[SC]/step goal*100

2 Likes

BTW, you can use new function to simplify the complex tag expressions from 1.0.11 version.

Before

((([SC]*0.745)-([SC]*0.745)%1000)/1000% 100 ).((([SC]*0.745)%1000-([SC]*0.745)%100)/100)((([SC]*0.745)%100-([SC]*0.745)%10)/10)

After

(numberFormat(β€œ#.##”, ([SC]*0.000745)))

1 Like

Thanks for the reply and yes Peter of course you are correct I guess I was trying to show a percentage bar with a range of say 0 to 7.45 KM different to say 1 - 10000 steps but it’s all coming from the limitation of having to use SC.

and Sinjae thank you for the new simple expressions I will give that a go on the next face.

1 Like