Negative decimals rounding

  • What Grafana version and what operating system are you using?

grafana playground

  • What are you trying to achieve?

not rounded negative decimal numbers

  • How are you trying to achieve it?

  • What happened?

the value gets rounded

  • What did you expect to happen?

see exact value

  • Can you copy/paste the configuration(s) that you are having problems with?

grafana play

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

no errors

  • Possible BUG

grafana/valueFormats.test.ts at 2107652c3fdeebf499c360795c219f68ef47b65f · grafana/grafana · GitHub
or,
grafana/valueFormats.ts at 2107652c3fdeebf499c360795c219f68ef47b65f · grafana/grafana · GitHub

Don’t want the numbers to be rounded up. The problem is with negative decimal numbers only. I need the negative numbers as it is.

ah gotcha. but I think that is a bug in grafana, not sure why it takes over when decimal is on auto.

image

image

1 Like

Thanks for the reply. Seems so. The problem is most probably with the valueFormat function. not an expert on JavaScript.

1 Like

thanks for the tips. the data is basically there. it just does not show up in certain visualization. the search for decimal and removal of ‘auto’ did the trick. :slight_smile:

1 Like

tested it in console log and I think you are correct

image

decimals is 0

Added a bug