# Aggregations do not add up float values

**URL:** <https://discuss.elastic.co/t/aggregations-do-not-add-up-float-values/49324>\
**Category:** Elasticsearch\
**Created:** [May 5, 2016, 5:44pm UTC](https://discuss.elastic.co/t/aggregations-do-not-add-up-float-values/49324 "2016-05-05T17:44:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![apt275](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@apt275](https://discuss.elastic.co/u/apt275)\
**Post date:** [May 5, 2016, 5:44pm UTC](https://discuss.elastic.co/t/aggregations-do-not-add-up-float-values/49324/1 "2016-05-05T17:44:41Z")

</div>

Here is what i have in one of my columns

[![enter image description here](http://i.stack.imgur.com/AbjeN.png)](http://i.stack.imgur.com/AbjeN.png)

so, all of these values add up to 1.272. Now i tried to create a metric visualization for it but i get

[![enter image description here](http://i.stack.imgur.com/hcnl8.png)](http://i.stack.imgur.com/hcnl8.png)

why is it 0? The field is of type number in the index.

**Update**

So i tried to run this in sense

```
post indexName/_search
{
  "size": 0,
  "aggs": {
        "sum block": {
          "sum": {
            "field": "blockSize"
          }
        }
      }
    }
  }
}

```

and i get

```
{
  "took": 4,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 12,
    "max_score": 0,
    "hits": []
  },
  "aggregations": {
    "sum block": {
      "value": 0
    }
  }
}

```

why is this happening? Should it not add up the float values? also, in the index mapping

```
"blockSize": {
            "type": "long"
          }

```

shouldn't this be float or double? and if it is long, then why does it store a decimal point with the values?

---

<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 5, 2017, 10:53pm UTC](https://discuss.elastic.co/t/aggregations-do-not-add-up-float-values/49324/2 "2017-07-05T22:53:39Z")

</div>


