# Format numbers with color and decimal places in metric aggregation

**URL:** <https://discuss.elastic.co/t/format-numbers-with-color-and-decimal-places-in-metric-aggregation/221703>\
**Category:** Kibana\
**Created:** [March 2, 2020, 2:43pm UTC](https://discuss.elastic.co/t/format-numbers-with-color-and-decimal-places-in-metric-aggregation/221703 "2020-03-02T14:43:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mtudisco](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@mtudisco](https://discuss.elastic.co/u/mtudisco)\
**Post date:** [March 2, 2020, 2:43pm UTC](https://discuss.elastic.co/t/format-numbers-with-color-and-decimal-places-in-metric-aggregation/221703/1 "2020-03-02T14:43:43Z")

</div>

Hi,  
I have a metric that i sotore with 2 decimal places, it is a number between 0 and 100 representing a percentage. Then i have a table visualization in kibana showing that number with the top hit aggregation. I want to show the number with different colors depending on the value, but when i use the color format for the index pattern, then the table shows the value with several decimal places. Is there a way to use both color formatting and number formatting for the numbers?

The other problem i noticed, is that even when i store that metric with 2 decimal places, when i show the table with top hit metric aggregation, and then aggregate with "max" then when i format the number with color and it show several decimal places, i see numbers not 0 after the second decimal place. So where and how does it get those values?

thanks

---

<div class="post-metadata">

**Author:** ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)\
**Post date:** [March 24, 2020, 12:38pm UTC](https://discuss.elastic.co/t/format-numbers-with-color-and-decimal-places-in-metric-aggregation/221703/2 "2020-03-24T12:38:04Z")

</div>

Hi @mtudisco

What visualization exactly are you using? Can you share which version of the stack you are using and maybe some screenshots of your current status?

Best

---

<div class="post-metadata">

**Author:** ![mtudisco](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@mtudisco](https://discuss.elastic.co/u/mtudisco)\
**Post date:** [March 24, 2020, 12:58pm UTC](https://discuss.elastic.co/t/format-numbers-with-color-and-decimal-places-in-metric-aggregation/221703/3 "2020-03-24T12:58:16Z")

</div>

Hi Jorge, its a table visualization, Kibana 7.2  
I'm no longer able to show a screenshot as i changed the number from float to integer and stored it without decimal places to bypass the problem.

---

<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:** [April 21, 2020, 12:58pm UTC](https://discuss.elastic.co/t/format-numbers-with-color-and-decimal-places-in-metric-aggregation/221703/4 "2020-04-21T12:58:17Z")

</div>

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