# Conditional and "if function"

**URL:** <https://forum.bubble.io/t/conditional-and-if-function/209943>\
**Category:** Responsiveness\
**Created:** [June 6, 2022, 3:07pm UTC](https://forum.bubble.io/t/conditional-and-if-function/209943 "2022-06-06T15:07:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![LSL](https://avatars.discourse-cdn.com/v4/letter/l/e95f7d/32.png) [@LSL](https://forum.bubble.io/u/LSL)\
**Post date:** [June 6, 2022, 3:07pm UTC](https://forum.bubble.io/t/conditional-and-if-function/209943/1 "2022-06-06T15:07:17Z")

</div>

Hi,

In my application, I want the font color to turn red when the number entered in input 2 is superior to 80% of the number entered in input 1. How can I proceeed?

Thank you,

L

---

<div class="post-metadata">

**Author:** ![ri\_scc\_94](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@ri\_scc\_94](https://forum.bubble.io/u/ri_scc_94)\
**Post date:** [June 6, 2022, 7:09pm UTC](https://forum.bubble.io/t/conditional-and-if-function/209943/2 "2022-06-06T19:09:17Z")

</div>

Hi, you could set a Conditional in your element.  
Conditional:  
When input 1’s value \* 0.8 \< input 2’s value  
 → Font color (#ff0000)

another way to do it:  
when input 2’s value / 0.8 \>= input 1’s value

---

<div class="post-metadata">

**Author:** ![LSL](https://avatars.discourse-cdn.com/v4/letter/l/e95f7d/32.png) [@LSL](https://forum.bubble.io/u/LSL)\
**Post date:** [June 6, 2022, 8:11pm UTC](https://forum.bubble.io/t/conditional-and-if-function/209943/3 "2022-06-06T20:11:09Z")

</div>

Hi ric,

Thank you for your answer, but I don’t have the option of doing \*0.8 or /0.8 when I config the conditional. Here an example.

 ![Capture d’écran 2022-06-06 160804](https://us1.discourse-cdn.com/bubble/original/3X/a/1/a1888126984fe5b0fe6222dc3a9373f65e2d311a.png)

---

<div class="post-metadata">

**Author:** ![rpetribu](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/rpetribu/32/90852_2.png) [@rpetribu](https://forum.bubble.io/u/rpetribu)\
**Post date:** [June 6, 2022, 8:16pm UTC](https://forum.bubble.io/t/conditional-and-if-function/209943/4 "2022-06-06T20:16:17Z")

</div>

Your input’s content type must be set to NUMBER.

---

<div class="post-metadata">

**Author:** ![LSL](https://avatars.discourse-cdn.com/v4/letter/l/e95f7d/32.png) [@LSL](https://forum.bubble.io/u/LSL)\
**Post date:** [June 6, 2022, 8:20pm UTC](https://forum.bubble.io/t/conditional-and-if-function/209943/5 "2022-06-06T20:20:06Z")

</div>

Indeed, I just realize.

Thanks a lot guys!
