Hide weather when no Location is off

I’ve been trying to hide the weather text when Location is off, so that it doesn’t show “—”.
The icon already hides on its own.
Below I’ve put a text with the temperature (#WCT##WM#°) and this expression in the trasparency field:
But it still shows up as —°
How can I correctly check for the availability of location data?

Thank you!

I don’t know how to check for validity / availabiltiy of data but you could try the following ( not sure if it will work but something similar helped me overcome a like problem with #BLN# when it changes from a number to two dashes) :

Set transparency to: $#WCT#>-100?100:0$

The idea is that the conditional will fail if #WCT# is not a number and hence the transparency will default to 0.

Hope it helps.


That worked!
And it’s probably even “safer” to rely on different types than being equal to an exact string.

1 Like

I’m glad it worked!

1 Like