Format number
Hi All.
I would like to format my numbers to always display 2 decimal places, rounding where applicable.
Thanks,
Ran
-
Hello Ran!
Please check out this page on our documentation site: https://help.sumologic.com/05Search/Search-Query-Language/Search-Operators/format
It talks about one of the ways you can achieve what you need using format() operator.
Please let me know if you have any further questions.
-
Moreover the aggregate functions cannot be plotted as graph if it is not a number. So please suggest a viable solution if I want to show only 2 decimals.
I did the below but now it is not showing me it as graph:
- | round(_avg, 1) as _avg
- | format("%.1f", _avg) as _avg
If I add the below (to the above):
- | num(_avg) as _avg
then it enables the graphing option (like chart) but it displays the trailing 3 zeros, which I do not want
- 47.90000
Any suggestion?
Please sign in to leave a comment.
Comments
5 comments