# Float number rounding in Kibana

**URL:** <https://discuss.elastic.co/t/float-number-rounding-in-kibana/26108>\
**Category:** Kibana\
**Created:** [July 22, 2015, 7:11pm UTC](https://discuss.elastic.co/t/float-number-rounding-in-kibana/26108 "2015-07-22T19:11:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![palmerabollo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/palmerabollo/32/44772_2.png) [@palmerabollo](https://discuss.elastic.co/u/palmerabollo)\
**Post date:** [July 22, 2015, 7:11pm UTC](https://discuss.elastic.co/t/float-number-rounding-in-kibana/26108/1 "2015-07-22T19:11:10Z")

</div>

I have many documents with a floating field ("duration") representing the response time of a HTTP request in seconds. Its value is always smaller than one (example: 0.018). I want to visualize the average response times in kibana.

I am able to create a new visualization with the average value of the "duration" field. The problem is that it is always rounded to 0. I've also tried creating a scripted field using doc['duration'].value \* 1000.0, but the value of the scripted field is also zero.

How could I calculate the average or, in general, work with small floating values in Kibana?  
Thanks.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 23, 2015, 7:27am UTC](https://discuss.elastic.co/t/float-number-rounding-in-kibana/26108/2 "2015-07-23T07:27:02Z")

</div>

Take a look at field formatters and see if that help? [https://www.elastic.co/blog/kibana-4-1-field-formatters](https://www.elastic.co/blog/kibana-4-1-field-formatters)

Otherwise, what is the mapping you are using for the field in the doc?

---

<div class="post-metadata">

**Author:** ![palmerabollo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/palmerabollo/32/44772_2.png) [@palmerabollo](https://discuss.elastic.co/u/palmerabollo)\
**Post date:** [July 23, 2015, 7:44am UTC](https://discuss.elastic.co/t/float-number-rounding-in-kibana/26108/3 "2015-07-23T07:44:38Z")

</div>

Thanks @warkolm. The field is mapped as a number: ![](https://us1.discourse-cdn.com/elastic/original/2X/7/753cebe9a6354b40a0d52f922e04125f390c49cd.PNG)  
Ands I see it as a valid number:  
 ![](https://us1.discourse-cdn.com/elastic/original/2X/8/8816184cf883ff25d977d00a38cf3bc9623d0627.PNG)

It was my fault. I did something wrong because everything works fine now (after creating/removing the scripted field and having some sleep).

Sorry for wasting your time.

---

<div class="post-metadata">

**Author:** ![sanaya](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@sanaya](https://discuss.elastic.co/u/sanaya)\
**Post date:** [September 1, 2015, 2:40pm UTC](https://discuss.elastic.co/t/float-number-rounding-in-kibana/26108/4 "2015-09-01T14:40:48Z")

</div>

What was it that you were doing incorrectly?  
I'm having the same issue as well, and have seen several queries online about this with no resolutions.

Thanks!

---

<div class="post-metadata">

**Author:** ![palmerabollo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/palmerabollo/32/44772_2.png) [@palmerabollo](https://discuss.elastic.co/u/palmerabollo)\
**Post date:** [September 1, 2015, 4:46pm UTC](https://discuss.elastic.co/t/float-number-rounding-in-kibana/26108/5 "2015-09-01T16:46:00Z")

</div>

I'm sorry @sanaya but I don't know. I just removed the scripted field and created it again, and it started worked.

---

<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, 2:13pm UTC](https://discuss.elastic.co/t/float-number-rounding-in-kibana/26108/6 "2017-07-06T14:13:54Z")

</div>


