YNR
YNR

Reputation: 875

Set decimal places in visulization in Kibana

I'd like to set decimal places with I create visulization in Kibana 7.12. The visualization could be TSVB, Gauge, aggregation, or lens. I want to show the average of a field for example. So I can't change the index pattern. I found that might be using Markdown helps in TSVB aggregation, but the solution doesn't work.

{{ avg.v.last.formatted }}
 Handlebars.registerHelper('function', function(v) {
 return v.toFixed(2);
 });

Upvotes: 2

Views: 3337

Answers (3)

majere
majere

Reputation: 76

I know it's an old question, but I was also struggling with it, and this post was my first Google hit, so I decided to share my solution (stack version 8.10.1).

Here's what worked for me:

  1. Convert to Lens: Convert to Lens1

  2. Field Configuration: In the field configuration, I could specify the value format to "Number" and select the desired number of decimal places.

enter image description here

Upvotes: 0

Ed MacDonald
Ed MacDonald

Reputation: 416

Look at the Options tab for the Gage or Metric. Choose "Custom" for the Data Formatter and use a numeral.js format string (eg "0." specifies nothing after the decimal).

enter image description here

Upvotes: 0

Musab Dogan
Musab Dogan

Reputation: 3580

You can use Kibana > Stack Management > Advanced Settings > Number Format to set decimals. For example, picture 1 shows the decimals after the point. When adjustments are made from the Advanced Settings section as in picture 2, the decimal part after the point disappears picture.

Also, you can adjust Byte, Currency, Number, Percent formats. In addition, you can set how many digits these formats appear, and which punctuation mark you want to use in the thousands place. additional info

Number Format: 0,0.[000]
New Number Format: 0,0

Upvotes: 0

Related Questions