# Unsigned\_long value is not precise

**URL:** <https://discuss.elastic.co/t/unsigned-long-value-is-not-precise/369967>\
**Category:** Elasticsearch\
**Created:** [November 3, 2024, 3:58pm UTC](https://discuss.elastic.co/t/unsigned-long-value-is-not-precise/369967 "2024-11-03T15:58:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![avnere](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@avnere](https://discuss.elastic.co/u/avnere)\
**Post date:** [November 3, 2024, 3:58pm UTC](https://discuss.elastic.co/t/unsigned-long-value-is-not-precise/369967/1 "2024-11-03T15:58:24Z")

</div>

We are using elasticsearch v.8.12.2.  
We defined in some of our fields with type of unsigned\_long.

In large numbers we see that the number we want to store is not the number actually stored in elastic.  
For example: We are saving the number 9178199893404114494, elastic store it as 9178199893404115000.

Is there a way to fix this?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [November 3, 2024, 4:07pm UTC](https://discuss.elastic.co/t/unsigned-long-value-is-not-precise/369967/2 "2024-11-03T16:07:57Z")

</div>

Does the behaviour change if you send the number formatted as a string? Elasticsearch will still store it in the format defined in the mapping, but I have seen this technique used to avoid [precision limitation in JSON parsers](https://www.pullrequest.com/blog/safely-handling-large-integers-in-json-best-practices-and-pitfalls/).
