How to round to 2 digits after comma scripted field parameter value

Management/Index Patterns/{indexing}/scripted field
Screenshot from 2021-08-20 11-29-44
Visualize
Screenshot from 2021-08-20 11-30-46
Visualize
Screenshot from 2021-08-20 11-31-21

please all help

Go to "Stack Management" -> "Index Patterns" and select your index pattern. Find your scripted field and edit. Check "Set format" and select "number". Then specify the number of digits you want to display.

Hai @Nathan_Reese Thanks in advance for responding quickly, I've tried your suggestion but not working.

because the scripted field is here not in the field

What version of kibana are you using? You can format runtime fields, which are the replacement for scripted fields. Otherwise, you could updated your script to round the number for you

thanks again for your response, I use kibana:7.6.2

how to format runtime fields, which are the replacement for scripted fields ?

hi @Nathan_Reese , how to format runtime fields, which are the replacement for scripted fields ?

Runtime fields do not exist in 7.6.

You can either

  • upgrade and use runtime fields and then create a field formatter to round your number as outlined in the documentation.
  • update your scripted field to round the number as part of the script

big thanks response @Nathan_Reese . after a long journey, I found a trick like this need to add metric datasweet
Screenshot from 2021-09-24 01-31-43