# Trying to OR multiple decimals to change button color

**URL:** <https://forum.inductiveautomation.com/t/trying-to-or-multiple-decimals-to-change-button-color/66367>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [November 10, 2022, 8:13pm UTC](https://forum.inductiveautomation.com/t/trying-to-or-multiple-decimals-to-change-button-color/66367 "2022-11-10T20:13:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Melton](https://avatars.discourse-cdn.com/v4/letter/p/779978/32.png) [@Paul\_Melton](https://forum.inductiveautomation.com/u/Paul_Melton)\
**Post date:** [November 10, 2022, 8:13pm UTC](https://forum.inductiveautomation.com/t/trying-to-or-multiple-decimals-to-change-button-color/66367/1 "2022-11-10T20:13:18Z")

</div>

Hi,  
I am trying to change a button color based on the decimal value from several tags.  
If the value of any of the tags is 3, the result will be red,  
If the value of any of the tags is not 3, the result will be yellow,  
I want to use a statement of this structure because i will have 5 tags and 4 colors.  
This is what I have at the moment:  
if(({[default]P1DD9999} | {[default]P1DD9998}) = 3,   
color (255,0,0),   
color (255,255,0))

I think the problem is the OR operator?

Thanks

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [November 10, 2022, 8:21pm UTC](https://forum.inductiveautomation.com/t/trying-to-or-multiple-decimals-to-change-button-color/66367/2 "2022-11-10T20:21:46Z")

</div>

It's both the or (you are using bitwise or) and your syntax.

You need to compare each tag to 3 eg

```auto
if({t1} = 3 || {t2} = 3
  , red.... 
  , yellow... 
) 

```

---

<div class="post-metadata">

**Author:** ![Paul\_Melton](https://avatars.discourse-cdn.com/v4/letter/p/779978/32.png) [@Paul\_Melton](https://forum.inductiveautomation.com/u/Paul_Melton)\
**Post date:** [November 10, 2022, 8:30pm UTC](https://forum.inductiveautomation.com/t/trying-to-or-multiple-decimals-to-change-button-color/66367/3 "2022-11-10T20:30:49Z")

</div>

Works brilliant.  
Thank you so much!
