# 0's after decimal places are absent in elastic search

**URL:** <https://discuss.elastic.co/t/0s-after-decimal-places-are-absent-in-elastic-search/187808>\
**Category:** Elasticsearch\
**Created:** [June 27, 2019, 10:33am UTC](https://discuss.elastic.co/t/0s-after-decimal-places-are-absent-in-elastic-search/187808 "2019-06-27T10:33:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gaurav\_Narang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gaurav_narang/32/48919_2.png) [@Gaurav\_Narang](https://discuss.elastic.co/u/Gaurav_Narang)\
**Post date:** [June 27, 2019, 10:33am UTC](https://discuss.elastic.co/t/0s-after-decimal-places-are-absent-in-elastic-search/187808/1 "2019-06-27T10:33:54Z")

</div>

I have taken the type of a field in elastic search as double and while ingesting any value which has some 0's after decimal place then the 0's after decimal place is not shown. For example: for value 23.0 is converted to 23

PFB the mapping which I have used:

```auto
curl -X PUT "localhost:9200/test" -H 'Content-Type: application/json' -d'
{
  "mappings": {
    "abc": {               
      "properties": {            
        "price": {
          "type": "double"
        },
        "mrp": {
          "type": "long"
        }
      }
    }
  },
  "settings": {
     "index.mapping.coerce": false
  }
}'

```

I expect output for 23.0 to be exactly the same which is 23.0 itself and for integer values I also exppect 23 to be converted itself to 23.0 Please provide an appropriate solution.

Using elastic search version 6.5.0

---

<div class="post-metadata">

**Author:** ![Wolfram\_Haussig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfram_haussig/32/70528_2.png) [@Wolfram\_Haussig](https://discuss.elastic.co/u/Wolfram_Haussig)\
**Post date:** [June 28, 2019, 5:51am UTC](https://discuss.elastic.co/t/0s-after-decimal-places-are-absent-in-elastic-search/187808/2 "2019-06-28T05:51:36Z")

</div>

Why do you want to store the zero? What is your usecase?

My guess is: It works as designed as the value "23" is stored as double in ElasticSearch while "23.0" or even "23.00000" is the same value in a different format.

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [July 1, 2019, 5:54am UTC](https://discuss.elastic.co/t/0s-after-decimal-places-are-absent-in-elastic-search/187808/3 "2019-07-01T05:54:03Z")

</div>

> [@Gaurav\_Narang](#):
>
> I expect output for 23.0 to be exactly the same which is 23.0 itself

What output are you referring to?

---

<div class="post-metadata">

**Author:** ![Gaurav\_Narang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gaurav_narang/32/48919_2.png) [@Gaurav\_Narang](https://discuss.elastic.co/u/Gaurav_Narang)\
**Post date:** [July 1, 2019, 6:06am UTC](https://discuss.elastic.co/t/0s-after-decimal-places-are-absent-in-elastic-search/187808/4 "2019-07-01T06:06:44Z")

</div>

Output : Data which is seen in my index

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [July 1, 2019, 7:22am UTC](https://discuss.elastic.co/t/0s-after-decimal-places-are-absent-in-elastic-search/187808/5 "2019-07-01T07:22:59Z")

</div>

What API are you calling? What _exactly_ are you referring to?

---

<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 29, 2019, 7:23am UTC](https://discuss.elastic.co/t/0s-after-decimal-places-are-absent-in-elastic-search/187808/6 "2019-07-29T07:23:00Z")

</div>

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