It appears that math inside a conditional is buggy. I tested all of the below by assigning the result to a text box.
This returns 17 as expected:
$floor(1.5)*12==24?12:17$
These all return empty strings:
$floor(40/29)*12==24?12:17$
$(floor(40/29)*12)==24?12:17$
$(floor(40/29)*12==24)?12:17$
From a conditional standpoint, they should all be the same. If I remove it from the conditional and just output the result, it works.
I think this is the same problem that we are experiencing. The engine is not parsing conditionals correctly.
Ah, I think I found the problem.
I went back and upgraded my color example that you used originally (here ). This is something I knew worked in the past, both on the watch and the web designer. It was set up for PBP - the watch’s battery level, so I included the phone’s battery as well.
[image]
For all of these images, Rightclick > View Image … to see the full size.
Those numbers below are for debugging - it shows the computation of the ternary operator function. It’s going to essentially boi…
marcus
September 23, 2016, 10:08pm
3
Hi @CompuChip - We’ve identified this as a bug and will be pushing a fix for it on the web early next week. In the meantime, if you use the expression below, it should work as expected on the phone & watch:
$(floor(40/29)*12)==24?12:17$
Let us know if you run into any other issues!
1 Like
Hi @marcus ,
Thanks for the info; I’ll just wait for the fix next week. The actual formula I’m trying to use is much more complicated than my example.
Thanks,
Chip
marcus
September 26, 2016, 7:27pm
5
@CompuChip , we just pushed that update today, so you should be good to go!
1 Like
Awesome @marcus ! I tested and it appears to function correctly even on my overly complicated formula! Hopefully, I’ll have time this week to wrap up the watchface I’m working on that needed that functionality!
1 Like
marcus
September 27, 2016, 5:38pm
7
@CompuChip That’s great to hear! Looking forward to seeing the final design!
Thanks @marcus - here is my effort. I’ve created a phases of the moon watch. It still isn’t as pretty as I’d like, but it is accurrate
1 Like
marcus
September 28, 2016, 11:18pm
9
@CompuChip Wow, that’s awesome!