Feature request: configure significant digits
See original GitHub issueIssue
See the screenshot below: On the left, a default lovelace sensor (I have no idea what’s up with the graph, ranges are the same).
I have 6 different electricity metering rates (EDF TEMPO):
- 0.1231 (low demand day, off-peak)
- 0.1498 (low demand day, peak hours)
- 0.1412 (medium demand day, off-peak)
- 0.1773 (medium demand day, peak hours)
- 0.1509 (high demand day, off-peak)
- 0.6274 (high demand day, peak hours)
I am not sure 2 digits are enough. In any case, there might be some other cases where they are absolutely significant.
Suggested fix
Either add a setting to change the number of significant digits, or provide a formatspec-compatible (python’s or a subset) way of specifying it.
This would also help with #643.
Ideally, a format field should support a full {{ template }}
syntax, but I think the formatting happens in javascript, so making it compatible with jinja templates would be a complex project. On the other hand, I am pretty sure javascript supports a similar formatspec.
That way, I could display € cents instead of decimal € (another approach would be to create a new sensor, but that’s something I’d rather avoid).
Issue Analytics
- State:
- Created a year ago
- Comments:7
Top GitHub Comments
Still an active issue, got it! Removing stale label.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this is still an active issue, please let us know!