# Numeric precision in terms\_stats facet

**URL:** <https://discuss.elastic.co/t/numeric-precision-in-terms-stats-facet/8409>\
**Category:** Elasticsearch\
**Created:** [July 13, 2012, 6:32pm UTC](https://discuss.elastic.co/t/numeric-precision-in-terms-stats-facet/8409 "2012-07-13T18:32:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pat\_Christopher\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pat_christopher_2/32/2434_2.png) [@Pat\_Christopher\_2](https://discuss.elastic.co/u/Pat_Christopher_2)\
**Post date:** [July 13, 2012, 6:32pm UTC](https://discuss.elastic.co/t/numeric-precision-in-terms-stats-facet/8409/1 "2012-07-13T18:32:28Z")

</div>

I'm using a terms\_stats facet to sum timestamps over a search period. Its  
wacky but fun. The result I'm getting back looks like this:

"facets" : {  
"elapsed\_time" : {  
"\_type" : "terms\_stats",  
"missing" : 0,  
"terms" : [ {  
"term" : "term\_I\_wanted",  
"count" : 318,  
"total\_count" : 318,  
"min" : -5928.0,  
"max" : 126417.0,  
"total" : 2.4781647E7,  
"mean" : 77929.7075471698  
}

the total field in the returned document is using scientific notation for  
any amount over 7 digits. I would like it to never switch to that format.  
Is there a parameter I can set to force that behavior?

Thanks,  
Pat

---

<div class="post-metadata">

**Author:** ![Juuso\_Kosonen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/juuso_kosonen/32/2432_2.png) [@Juuso\_Kosonen](https://discuss.elastic.co/u/Juuso_Kosonen)\
**Post date:** [March 19, 2013, 11:06am UTC](https://discuss.elastic.co/t/numeric-precision-in-terms-stats-facet/8409/2 "2013-03-19T11:06:31Z")

</div>

Hey, I'm interested in the same problem. Did you find any answer?

Thanks

On Friday, July 13, 2012 9:32:28 PM UTC+3, Pat Christopher wrote:

> I'm using a terms\_stats facet to sum timestamps over a search period. Its  
> wacky but fun. The result I'm getting back looks like this:
> 
> "facets" : {  
> "elapsed\_time" : {  
> "\_type" : "terms\_stats",  
> "missing" : 0,  
> "terms" : [ {  
> "term" : "term\_I\_wanted",  
> "count" : 318,  
> "total\_count" : 318,  
> "min" : -5928.0,  
> "max" : 126417.0,  
> "total" : 2.4781647E7,  
> "mean" : 77929.7075471698  
> }
> 
> the total field in the returned document is using scientific notation for  
> any amount over 7 digits. I would like it to never switch to that format.  
> Is there a parameter I can set to force that behavior?
> 
> Thanks,  
> Pat

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Pat\_Christopher\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pat_christopher_2/32/2434_2.png) [@Pat\_Christopher\_2](https://discuss.elastic.co/u/Pat_Christopher_2)\
**Post date:** [March 19, 2013, 3:05pm UTC](https://discuss.elastic.co/t/numeric-precision-in-terms-stats-facet/8409/3 "2013-03-19T15:05:05Z")

</div>

Sadly I did not. I was subtracting the sum field by another number within  
about ten thousand. I was calculating rolling averages over time boxed  
windows. I was able to rearrange the math to never hit these absurdly large  
numbers.

Sorry I couldn't help,  
Pat  
On Mar 19, 2013 4:06 AM, "Juuso Kosonen" [juuson@gmail.com](mailto:juuson@gmail.com) wrote:

> Hey, I'm interested in the same problem. Did you find any answer?
> 
> Thanks
> 
> On Friday, July 13, 2012 9:32:28 PM UTC+3, Pat Christopher wrote:
> 
> > I'm using a terms\_stats facet to sum timestamps over a search period.  
> > Its wacky but fun. The result I'm getting back looks like this:
> > 
> > "facets" : {  
> > "elapsed\_time" : {  
> > "\_type" : "terms\_stats",  
> > "missing" : 0,  
> > "terms" : [ {  
> > "term" : "term\_I\_wanted",  
> > "count" : 318,  
> > "total\_count" : 318,  
> > "min" : -5928.0,  
> > "max" : 126417.0,  
> > "total" : 2.4781647E7,  
> > "mean" : 77929.7075471698  
> > }
> > 
> > the total field in the returned document is using scientific notation for  
> > any amount over 7 digits. I would like it to never switch to that format.  
> > Is there a parameter I can set to force that behavior?
> > 
> > Thanks,  
> > Pat
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/6os5fixTH4E/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/6os5fixTH4E/unsubscribe?hl=en-US)  
> .  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:45am UTC](https://discuss.elastic.co/t/numeric-precision-in-terms-stats-facet/8409/4 "2017-07-06T02:45:46Z")

</div>


