# Weather expressions again with WCCI

hey all,
I’m fooling around with a traditional complication that has a small pointer hand sweeping 100-degrees (50-degrees left of center, 50-degrees right of center) to display some simple quick-view weather conditions. It’s either clear, stormy, or somewhere in between with one gauge.

I’m assigning the following behaviors in the rotation field:
01 Fair - points left… Clear
02 few clouds - points left… Clear
03 scattered clouds - points up - somewhere in-between clear and stormy
04 broken clouds - points up - somewhere in-between clear and stormy
09 shower rain - points right - Stormy
10 rain - points right - Stormy
11 thunderstorm - points right - Stormy
13 snow - points right - Stormy
50 mist - points right - Stormy

I’m doing it in one nested expression:
\$#WCCI#=1?-50:\$\$#WCCI#=2?-50:\$\$#WCCI#=3?0:\$\$#WCCI#=4?0:\$\$#WCCI#=9?50:\$\$#WCCI#=10?50:\$\$#WCCI#=11?50:\$\$#WCCI#=13?50:\$\$#WCCI#=50?50:\$

It’s hard to test but as far as I can tell it’s working. Any of you math wizzes see anything I’m doing wrong here?

Thanks,
John

Will it let you nest that many expressions? I thought it was limited to two.

Yep it won’t fully work…
I would suggest something like this:

`\$#WCCI#>4?((((#WCCI#-6)/5)*100)-50):((((#WCCI#-1)/5)*100)-50)\$`

Wait, that won’t fully work - it will rotate more then +50 deg when weather goes above 10.
This should work better:

`\$#WCCI#>4?(clamp(((((#WCCI#-6)/5)*100)-50),(-50),50)):((((#WCCI#-1)/5)*100)-50)\$`

Thanks @Mellin! Giving it a test now

edit: Nice Mellin! that works too. I see what you’re doing. you converted the WCCI values into a sliding scale instead of just my three states (left, right, and center). I like yours better, it implies more graduations and states between a totally clear day and a totally raining thunderstorm.

Word!

John