# Same numbers dont equal

**URL:** https://discuss.elastic.co/t/same-numbers-dont-equal/92659
**Category:** Kibana
**Created:** [July 11, 2017, 1:28pm UTC](https://discuss.elastic.co/t/same-numbers-dont-equal/92659 "2017-07-11T13:28:32Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![magerRV](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@magerRV](https://discuss.elastic.co/u/magerRV)
#### Post date: [July 11, 2017, 1:28pm UTC](https://discuss.elastic.co/t/same-numbers-dont-equal/92659/1 "2017-07-11T13:28:33Z")

</div>

When I compare two equal numbers in a Scripted Field I get a Boolean = false. Hows is this possible?

My Numbers (first one: result of substraction , second a static number) are actually the same.  
Both are type double. I rounded them and compared them (11.94 == 11.94) , but Kibana gives me false

Can anyone help please ?!

---

<div class="post-metadata">

### Author: ![annizaki](https://avatars.discourse-cdn.com/v4/letter/a/46a35a/32.png) [@annizaki](https://discuss.elastic.co/u/annizaki)
#### Post date: [July 11, 2017, 1:36pm UTC](https://discuss.elastic.co/t/same-numbers-dont-equal/92659/2 "2017-07-11T13:36:33Z")

</div>

Can you show us the scripted field please?

This thread has some examples of comparing numbers, make sure you are following a similar pattern:

> [@Comparing two terms](https://discuss.elastic.co/t/comparing-two-terms/46897):
>
> In Kibana (e.g Visualise), is it possible to compare one term with another? For example, I have indexed records that contain an indoorTemp value and a setpointTemp value - I have a line chart that shows the indoorTemp over time (using the Date histogram on the x-axis), but I would like to find just those times (e.g. hour buckets), where the value of indoorTemp exceeded that of setpointTemp. I would settle for being able to show buckets where indoorTemp was greater than a constant (I can't see …

---

<div class="post-metadata">

### Author: ![magerRV](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@magerRV](https://discuss.elastic.co/u/magerRV)
#### Post date: [July 12, 2017, 12:16pm UTC](https://discuss.elastic.co/t/same-numbers-dont-equal/92659/3 "2017-07-12T12:16:58Z")

</div>

def a = doc['q60tu01.D329-GESAMT-DATEN.D329-VERTRAG-DATEN.D329-VTG-ZAHL-BEITR'].value; \>\> is 12.0  
def b = doc['q60tu01.D329-GESAMT-DATEN.D329-VERTRAG-DATEN.D329-VTG-RABATT-BEITR'].value; \>\> is 0.06  
def c = doc['Q17TA21.beitragRatierlich'].value; \>\> is 11.94

(Math.round(a \* 100.0) / 100.0) - (Math.round(b \* 100.0) / 100.0) == (Math.round(c \* 100.0) / 100.0)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [August 9, 2017, 12:17pm UTC](https://discuss.elastic.co/t/same-numbers-dont-equal/92659/4 "2017-08-09T12:17:02Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
