Show + symbol on positive numbers

Hi everyone, I’m using Grafana v9.3.1 and trying to get a ‘+’ symbol to show in front of positive numbers for my stat panels. I’ve tried converting the number to string and using regex but haven’t been able to get this to work.

Any help would be appreciated.

image

Have you had any luck finding a solution for this? Trying to do the same.

what is your data source, might be easier to do it there.

In my case I have a simple expression to get a percentage of relative change: ($A - $B) / $B

I’m using postgresql as my data source.

1 Like

so you want
($A - $B) / $B’s result as 23.5 %?

Since the formula is showing relative change, I just want a “+” or “-” before the percentage to make it clearer that it’s indicating change. Negative percentages show the “-”, but positive just shows the normal percentage (which could be confused as an absolute percentage rather than the change in percentage.

1 Like

cool. please provide real examples with numbers.

See screenshot - two graphs with the bottom red and green numbers showing the percentage of change relative to the previous timeframe. The red negative value on the left has the “-” correctly, and what I’d like is for the positive percentage on the right to have “+” before it to more clearly indicate that it’s reflecting change rather than an absolute percentage.

1 Like

Surely there’s a simple way to do this?

You ever find a way to do this? I have a table that has either positive or negative numbers and it’d be really nice if the positives had pluses. I can’t do it in my source (plus doing so would break any kind of sorting that the Grafana table could do).

They should add this as a feature in the Standard Units as a checkbox underneath that says something like “Display + Symbol for Positive Numbers”.

Add a field override for Fields with values with the condition that the value >= 0. The override can be to add a unit prefix:+.

2 Likes