grafana / grafonnet

Jsonnet library for generating Grafana dashboards.
https://grafana.github.io/grafonnet/
Apache License 2.0
322 stars 19 forks source link

Use general instead of string interpolation in example #151

Closed DieBauer closed 7 months ago

DieBauer commented 7 months ago

The generated dashboard shows a quantile of '0.98999999999999999' (99/100) instead of a nicer 0.99 (https://github.com/grafana/grafonnet/blob/bb2afaffbcefeae1035cd691ab06a486e0022002/examples/redMethod/output.json#L87).
By changing the interpolation from string (%s) to general (%g) this is more correct (see https://docs.python.org/3/library/string.html#format-specification-mini-language for %g).

It also leaves 0.5 to 1 decimal, and 0.99 to 2, while using %f would format 0.5 as 0.50.

CLAassistant commented 7 months ago

CLA assistant check
All committers have signed the CLA.

Duologic commented 7 months ago

Nice, can you also update the rendered output.json to reflect this change? That should fix the failing smoke test.

DieBauer commented 7 months ago

Thanks, regenerated.