# Using formatting on Avg. Metric

**URL:** <https://discuss.elastic.co/t/using-formatting-on-avg-metric/113180>\
**Category:** Kibana\
**Created:** [December 26, 2017, 7:38am UTC](https://discuss.elastic.co/t/using-formatting-on-avg-metric/113180 "2017-12-26T07:38:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shubham\_Mahajan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shubham_mahajan/32/22140_2.png) [@Shubham\_Mahajan](https://discuss.elastic.co/u/Shubham_Mahajan)\
**Post date:** [December 26, 2017, 7:38am UTC](https://discuss.elastic.co/t/using-formatting-on-avg-metric/113180/1 "2017-12-26T07:38:34Z")

</div>

Hi Team,  
Is there a way to format the avg. value shown in figure to 1 decimal point or no decimal point using script or something?? here i am using gauge visualization and `Average metric of value field in doc`. But i want to format the value after doing the average. All the values in document is Integer only. Please help!!

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/a/ba7090d5acc0ceeaebff7f1d9cdd2436c3c72986.png)

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [December 26, 2017, 10:23pm UTC](https://discuss.elastic.co/t/using-formatting-on-avg-metric/113180/2 "2017-12-26T22:23:32Z")

</div>

Yes, there is a way to do this.

Go into the "Options" tab for your average metric, look for "Data formatter" and choose "Custom." Put in a formatting string of `0,0`. This will round the values that are displayed to whole numbers.

Default formatting, `0,0.[000]`

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/4/8469885fcbbad2e313e4bb58d91c5ee9d3d94a41.png)

Custom formatting, `0,0`

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/a/fae8b17bddf5e62b73b1e77fa740b634c3d59901.png)

For more formatting options, take a look at: [http://numeraljs.com/#format](http://numeraljs.com/#format)

---

<div class="post-metadata">

**Author:** ![Shubham\_Mahajan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shubham_mahajan/32/22140_2.png) [@Shubham\_Mahajan](https://discuss.elastic.co/u/Shubham_Mahajan)\
**Post date:** [December 27, 2017, 6:17am UTC](https://discuss.elastic.co/t/using-formatting-on-avg-metric/113180/3 "2017-12-27T06:17:19Z")

</div>

@tsullivan Thanks for the reply, Tim. But i was looking this feature in the Gauge visualization not in TSVB..Is there a way to do this in that??

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [December 27, 2017, 3:07pm UTC](https://discuss.elastic.co/t/using-formatting-on-avg-metric/113180/4 "2017-12-27T15:07:46Z")

</div>

Sorry, when you said "Gauge visualization," I thought you mean the one that is part of TSVB. I think the gauge plugin you're referring to is a 3rd party plugin [https://github.com/sbeyn/kibana-plugin-gauge-sg](https://github.com/sbeyn/kibana-plugin-gauge-sg). Someone from the user community might be able to help, or you could try asking the author of that plugin.

---

<div class="post-metadata">

**Author:** ![Shubham\_Mahajan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shubham_mahajan/32/22140_2.png) [@Shubham\_Mahajan](https://discuss.elastic.co/u/Shubham_Mahajan)\
**Post date:** [December 28, 2017, 6:08am UTC](https://discuss.elastic.co/t/using-formatting-on-avg-metric/113180/5 "2017-12-28T06:08:01Z")

</div>

Hi @sbeyn, do u know if this formatting kind can be done in Gauge Visualization???

---

<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:** [January 25, 2018, 6:08am UTC](https://discuss.elastic.co/t/using-formatting-on-avg-metric/113180/6 "2018-01-25T06:08:16Z")

</div>

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