{sscp} = 8543
{sscp} = 85
on Watch:
string.format(‘%.0f %%’, {sscp}) => 0 %
string.format(‘%.02f’, {ssc}*0.0007) => 0.00
{sscp} => 85.431
in watchmaker studio:
string.format(‘%.0f %%’, {sscp}) => 85 %
string.format(‘%.02f’, {ssc}*0.0007) => 5.98
{sscp} = 8543
{sscp} = 85
on Watch:
string.format(‘%.0f %%’, {sscp}) => 0 %
string.format(‘%.02f’, {ssc}*0.0007) => 0.00
{sscp} => 85.431
in watchmaker studio:
string.format(‘%.0f %%’, {sscp}) => 85 %
string.format(‘%.02f’, {ssc}*0.0007) => 5.98
solution:
safe rounding approach => math.floor(({ssc} * 0.0007) * 100 + 0.5) / 100
seems that watchmaker can’t work with string.format? are placeholder values treated strangely internally?
@AlexCurran …. any idea?
Hey Andrew — couldn’t reproduce on my side. Same string.format(‘%.0f’, …) formula with {ddy} and a few other tags transfers to the watch fine, so it’s not a blanket
string.format-on-substituted-tag problem. Looks specific to the fitness tags.
Do you definitely have non-zero values on watch for {ssc} / {sscp}
where does the comma come into the 31,916?
i wonder if thats the problem?
sscp devided by sscp delivers result with decimalplaces. If i use string.format to display only 2 decimalplaces it fails… see above first places where i multiplied
fixed now - please confirm
Result on watch::
string.format(‘%.0f %%’, {sscp}) => 0 %
string.format('%.02f ', {sscp}) => 0,00
Seems not to be fixed.
wait there seem to be 2 different bugs here
one was a bad division but the one you have here is saying its showing zero rather than number?
can you check you use correct quotes - it works for me
string.format(“%.0f %%”, {sscp})
Same result and doesn’t work. The quote ’ or " makes no difference
{sscp} shows 138,583
I have 8315 steps and goal is 6000
So percentage is 138,583
No idea why it shows decimalplaces on watch and why string.format not working…
should be fixed - can you try again now
string.format(‘%.0f %%’, {sscp}) … OK
string.format(‘%.02f %%’, {ssc} / {stsc} * 100) … NOT OK => 0,00 %
maybe multiply and division operation not working ?
i tried math operation inside string.format and that worked. so the solution is to use math operation => string.format(‘%.02f %%’, math.floor({ssc} / {stsc} * 100))
maybe it helps also other users fighting with that. cheers ;o)
The new version should work without your workaround