History chart rounding to 2 decimals, I don't want it to

I have a sensor monitoring values that range from 1.080 to 1.000. Sensor is displaying fine, but the history graph is rounding it to 2 decimals. For this sensor, I need precision to 3 decimals, preferably 4 in the history graph. Can the history graph(when clicking on the sensor and the graph display is brought up) be configured for significant digits?

1 Like

Not without modifying the HA source. See here, line 91, the formatNumber function takes an optional third argument that controls the number of significant digits shown. It’s not used by the history chart code though (it uses the default of 2), you’d have to hack it in.

Or (shameless plug incoming :grin:), use my brandnew history card. You can configure the number of significant digits using the rounding setting in the card configuration YAML (for example rounding: 4).

It used to be as many decimal places as the sensor provided, which was great. Now it’s stuck at 2. Dumb update

Was this ever resolved / improved? I’ve got some sensors that record data in the 0.01 and 0.001 range, meaning that the forced rounding to 2 decimal places removes all the information.

I also would need more than 2 decimals. Hopefully, some of the developers will read this.

Subscribe! I also need more than 2 decimals!

1 Like