# Wrong rounding up of sum in kibana

**URL:** <https://discuss.elastic.co/t/wrong-rounding-up-of-sum-in-kibana/49649>\
**Category:** Kibana\
**Created:** [May 10, 2016, 12:50pm UTC](https://discuss.elastic.co/t/wrong-rounding-up-of-sum-in-kibana/49649 "2016-05-10T12:50:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Benyamin\_Dvoskin](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@Benyamin\_Dvoskin](https://discuss.elastic.co/u/Benyamin_Dvoskin)\
**Post date:** [May 10, 2016, 12:50pm UTC](https://discuss.elastic.co/t/wrong-rounding-up-of-sum-in-kibana/49649/1 "2016-05-10T12:50:46Z")

</div>

Hi,

we've noticed that in some cases kibana is rounding up the sum for numbers we aggregate in a wrong way (or perhpas we just don't know how to configure it right...)

please see the 3 screenshots for amount.  
the 3 numbers (actual data sent in the original json) are the following:  
8.99  
11.99  
7.99

in the discovery tab, they are each rounded up to 9, 12 and 8.  
this should sum to 29.

but when we create a table visualization, the sum displayed is 26 (which is correct when rounding down).

any idea what's going on?

thanks,  
Benjamin

 ![](https://us1.discourse-cdn.com/elastic/original/2X/f/f5a4fbd42c3df9085844de694e190524baad2561.PNG)  
 ![](https://us1.discourse-cdn.com/elastic/original/2X/d/dbda96d2f37946daa3a13b929f7184a7d03b8845.PNG)  
 ![](https://us1.discourse-cdn.com/elastic/original/2X/5/56e71078dfb380aaa6b29494f13d71c72c6c09e7.PNG)  
 ![](https://us1.discourse-cdn.com/elastic/original/2X/b/bed9d66313467d5c17c7d71a72aafee7b96a8341.PNG)

---

<div class="post-metadata">

**Author:** ![BigFunger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bigfunger/32/7323_2.png) [@BigFunger](https://discuss.elastic.co/u/BigFunger)\
**Post date:** [May 10, 2016, 5:20pm UTC](https://discuss.elastic.co/t/wrong-rounding-up-of-sum-in-kibana/49649/2 "2016-05-10T17:20:24Z")

</div>

Can you post the mapping for that field?

[docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-field-mapping.html)  
`curl -XGET 'http://localhost:9200/logstash-*/_mapping/apache/field/@tags'` would return the mapping for the `@tags` field in the `apache` type of the `logstash-*` indices (with my ES endpoint being at `localhost:9200`)

---

<div class="post-metadata">

**Author:** ![Benyamin\_Dvoskin](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@Benyamin\_Dvoskin](https://discuss.elastic.co/u/Benyamin_Dvoskin)\
**Post date:** [May 10, 2016, 5:38pm UTC](https://discuss.elastic.co/t/wrong-rounding-up-of-sum-in-kibana/49649/3 "2016-05-10T17:38:08Z")

</div>

it's mapped as 'long'.

---

<div class="post-metadata">

**Author:** ![BigFunger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bigfunger/32/7323_2.png) [@BigFunger](https://discuss.elastic.co/u/BigFunger)\
**Post date:** [May 10, 2016, 5:57pm UTC](https://discuss.elastic.co/t/wrong-rounding-up-of-sum-in-kibana/49649/4 "2016-05-10T17:57:38Z")

</div>

According to the [docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html) the `long` type is an integer. So if I'm not mistaken, when the field is being summed by ES, it is being done so as integer values. You need to index these values as doubles.

---

<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:** [July 6, 2017, 1:53pm UTC](https://discuss.elastic.co/t/wrong-rounding-up-of-sum-in-kibana/49649/5 "2017-07-06T13:53:46Z")

</div>


