Perhaps it already exists, and I can't figure it out, but is there a way to format numbers?
Exemple:
I would like to have value 3.3333333333 writen like this 3.33
and value 6.666666666 writen like 6.66
prebuild kapacitor 0.11
@jdursel In which context are you formatting numbers? Alert messages?
In alert messages you can use the printf function {{ index .Fields "value" | printf "%0.2f" }} see https://golang.org/pkg/text/template/ and https://golang.org/pkg/fmt/ for more details.
Yes, indeed, this is in alert messages.
Thank you :-)
Most helpful comment
@jdursel In which context are you formatting numbers? Alert messages?
In alert messages you can use the
printffunction{{ index .Fields "value" | printf "%0.2f" }}see https://golang.org/pkg/text/template/ and https://golang.org/pkg/fmt/ for more details.