# How to suppress scientific notation returned for long numbers with Elasticsearch api?

**URL:** <https://discuss.elastic.co/t/how-to-suppress-scientific-notation-returned-for-long-numbers-with-elasticsearch-api/19772>\
**Category:** Elasticsearch\
**Created:** [September 13, 2014, 9:31pm UTC](https://discuss.elastic.co/t/how-to-suppress-scientific-notation-returned-for-long-numbers-with-elasticsearch-api/19772 "2014-09-13T21:31:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@Nick](https://discuss.elastic.co/u/Nick)\
**Post date:** [September 13, 2014, 9:31pm UTC](https://discuss.elastic.co/t/how-to-suppress-scientific-notation-returned-for-long-numbers-with-elasticsearch-api/19772/1 "2014-09-13T21:31:45Z")

</div>

Is there a way to suppress elasticsearch from sending a bit number field in  
scientific notation? For example, a field stored in ES, goal\_revenue:  
10000000, gets returned as goal\_revenue:1e+07 with the search api.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/2f947b82-a160-425d-b355-898efac72be6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2f947b82-a160-425d-b355-898efac72be6%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Nick](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@Nick](https://discuss.elastic.co/u/Nick)\
**Post date:** [September 13, 2014, 9:34pm UTC](https://discuss.elastic.co/t/how-to-suppress-scientific-notation-returned-for-long-numbers-with-elasticsearch-api/19772/2 "2014-09-13T21:34:03Z")

</div>

sorry, bit = big.

On Saturday, September 13, 2014 2:31:45 PM UTC-7, Nick wrote:

> Is there a way to suppress elasticsearch from sending a bit number field  
> in scientific notation? For example, a field stored in ES, goal\_revenue:  
> 10000000, gets returned as goal\_revenue:1e+07 with the search api.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/84c55872-4aca-43f1-af79-e44288c68bf5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/84c55872-4aca-43f1-af79-e44288c68bf5%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Nick](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@Nick](https://discuss.elastic.co/u/Nick)\
**Post date:** [September 13, 2014, 9:34pm UTC](https://discuss.elastic.co/t/how-to-suppress-scientific-notation-returned-for-long-numbers-with-elasticsearch-api/19772/3 "2014-09-13T21:34:03Z")

</div>

sorry, bit = big.

On Saturday, September 13, 2014 2:31:45 PM UTC-7, Nick wrote:

> Is there a way to suppress elasticsearch from sending a bit number field  
> in scientific notation? For example, a field stored in ES, goal\_revenue:  
> 10000000, gets returned as goal\_revenue:1e+07 with the search api.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/c3a8b95b-fecd-4826-91e0-820004698f4d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c3a8b95b-fecd-4826-91e0-820004698f4d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [September 14, 2014, 7:47am UTC](https://discuss.elastic.co/t/how-to-suppress-scientific-notation-returned-for-long-numbers-with-elasticsearch-api/19772/4 "2014-09-14T07:47:09Z")

</div>

ES uses Jackson, and Jackson uses Java Double.toString(), which has  
peculiarities for numbers \< 10^-3 or \>= 10^7 since it converts them to  
scientific notation.

There are two options:

- patching ES for optional format options of doubles, e.g.

NumberFormat nf = NumberFormat.getInstance();  
nf.setGroupingUsed(false);  
str = nf.format(d)

- or switch to BigInteger/BigDecimal by waiting for full  
BigInteger/BigDecimal support in Lucene and Elasticsearch

[https://issues.apache.org/jira/browse/LUCENE-5596](https://issues.apache.org/jira/browse/LUCENE-5596)

I sent in a format-only patch but it was extended to support also numeric  
range queries and aggregations which is a very difficult task.

Jörg

On Sat, Sep 13, 2014 at 11:31 PM, Nick [nick.dhupia@gmail.com](mailto:nick.dhupia@gmail.com) wrote:

> Is there a way to suppress elasticsearch from sending a bit number field  
> in scientific notation? For example, a field stored in ES, goal\_revenue:  
> 10000000, gets returned as goal\_revenue:1e+07 with the search api.
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/2f947b82-a160-425d-b355-898efac72be6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2f947b82-a160-425d-b355-898efac72be6%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/2f947b82-a160-425d-b355-898efac72be6%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/2f947b82-a160-425d-b355-898efac72be6%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHOW0sG7i9tQeDMWvdpLw0p7cvZNO2O23BBWDW3aGVcxg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHOW0sG7i9tQeDMWvdpLw0p7cvZNO2O23BBWDW3aGVcxg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:02am UTC](https://discuss.elastic.co/t/how-to-suppress-scientific-notation-returned-for-long-numbers-with-elasticsearch-api/19772/5 "2017-07-06T01:02:33Z")

</div>


