# Long value last 3 digits always gets 000

**URL:** <https://discuss.elastic.co/t/long-value-last-3-digits-always-gets-000/147506>\
**Category:** Elasticsearch\
**Created:** [September 6, 2018, 6:59am UTC](https://discuss.elastic.co/t/long-value-last-3-digits-always-gets-000/147506 "2018-09-06T06:59:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RRSR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rrsr/32/27766_2.png) [@RRSR](https://discuss.elastic.co/u/RRSR)\
**Post date:** [September 6, 2018, 6:59am UTC](https://discuss.elastic.co/t/long-value-last-3-digits-always-gets-000/147506/1 "2018-09-06T06:59:56Z")

</div>

I created an index using the below endpoint:

```
    PUT test/doc/1
{
  "id":1,
  "test_long": 2305843036566024123
}

```

Then when I try to get the same document using:

```
GET test/doc/1

```

The result I get is:

```
{
  "_index": "test",
  "_type": "doc",
  "_id": "1",
  "_version": 11,
  "found": true,
  "_source": {
    "id": 1,
    "test_long": 2305843036566024000
  }
} 

```

The issue is that I persisted `2305843036566024123` but what I get back is `2305843036566024000` so I lose the last 3 digits.

So what is the reason behind this and how can I fix the same?

---

<div class="post-metadata">

**Author:** ![tamara](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tamara/32/47095_2.png) [@tamara](https://discuss.elastic.co/u/tamara)\
**Post date:** [September 6, 2018, 7:44am UTC](https://discuss.elastic.co/t/long-value-last-3-digits-always-gets-000/147506/2 "2018-09-06T07:44:42Z")

</div>

Hi,

You are not losing the last digits, if you do a curl request as an example:

```
curl -XGET localhost:9200/test/doc/1 

```

Also you can try:

```
GET test/_search
{
  "query": {
    "match": {
      "test_long": 2305843036566024123
    }
  }
}

```

You can see the value is there and complete. You did not lose anything. This is a problem that is happening when displaying the value.

---

<div class="post-metadata">

**Author:** ![RRSR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rrsr/32/27766_2.png) [@RRSR](https://discuss.elastic.co/u/RRSR)\
**Post date:** [September 7, 2018, 4:12am UTC](https://discuss.elastic.co/t/long-value-last-3-digits-always-gets-000/147506/3 "2018-09-07T04:12:46Z")

</div>

Thanks, @tamara . It shows the correct value in the curl request. It is just due to the limitation of JavaScript that it is rounding off the last 3 digits.

---

<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:** [October 5, 2018, 4:12am UTC](https://discuss.elastic.co/t/long-value-last-3-digits-always-gets-000/147506/4 "2018-10-05T04:12:55Z")

</div>

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