# Integer instead of Float

**URL:** <https://discuss.elastic.co/t/integer-instead-of-float/255025>\
**Category:** Elasticsearch\
**Created:** [November 11, 2020, 8:59am UTC](https://discuss.elastic.co/t/integer-instead-of-float/255025 "2020-11-11T08:59:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![M2M](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@M2M](https://discuss.elastic.co/u/M2M)\
**Post date:** [November 11, 2020, 8:59am UTC](https://discuss.elastic.co/t/integer-instead-of-float/255025/1 "2020-11-11T08:59:53Z")

</div>

Hi  
I have problem when trying to display a value as float. kindly note that I can displayed properly in Discover but not the case for any type of visualisation  
for more details please refer to the below snapshots  
from Discover

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/5/d571333441751b5f555b006781ab0221b085ac04.png)

from Visualisation

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/6/761e93e23c7a216058c056d959b02294b5989ff9.png)

even the calculation in wrong when using json. always using the value as integer  
Example : Value1 = 3.85 value2 = 2.56  
Json value1 + Value2 =5 Should be **6.41**

below is the json script  
'''  
{  
"script"  
"inline": "doc['value1'].value + doc['value2'].value",  
"lang": "painless"

}  
'''  
I need the value to be displayed as floating and calculated as Floating  
Thanks

---

<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:** [December 9, 2020, 9:00am UTC](https://discuss.elastic.co/t/integer-instead-of-float/255025/2 "2020-12-09T09:00:04Z")

</div>

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