# DSL : Format avg result

**URL:** https://discuss.elastic.co/t/dsl-format-avg-result/341692
**Category:** Elasticsearch
**Created:** [August 25, 2023, 1:20pm UTC](https://discuss.elastic.co/t/dsl-format-avg-result/341692 "2023-08-25T13:20:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![RickT](https://avatars.discourse-cdn.com/v4/letter/r/3bc359/32.png) [@RickT](https://discuss.elastic.co/u/RickT)
#### Post date: [August 25, 2023, 1:20pm UTC](https://discuss.elastic.co/t/dsl-format-avg-result/341692/1 "2023-08-25T13:20:35Z")

</div>

Hi,

I'm using a DSL script to extract some datas.  
I use an aggregation with an **average method**. It's ok, but the end result does not suit me 😕

Indeed, the result format is like this **5133.076923076923** and I would like to get something like that **5133,07**  
Therefore, **two decimal** characters and a **comma** instead of the point.

My question is : is it possible to code the format of the result ?

A part of my code :

```auto
		"aggs": {
			"duration_moy": {
				"avg": {
				"field": "total.start.duration"
				}

```

Thanks.  
Rick

---

<div class="post-metadata">

### Author: ![RickT](https://avatars.discourse-cdn.com/v4/letter/r/3bc359/32.png) [@RickT](https://discuss.elastic.co/u/RickT)
#### Post date: [September 4, 2023, 7:53am UTC](https://discuss.elastic.co/t/dsl-format-avg-result/341692/2 "2023-09-04T07:53:51Z")

</div>

i'm searching always one solution... 😕

---

<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 2, 2023, 7:54am UTC](https://discuss.elastic.co/t/dsl-format-avg-result/341692/3 "2023-10-02T07:54:36Z")

</div>

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