question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: configure significant digits

See original GitHub issue

Issue

See the screenshot below: image 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:closed
  • Created a year ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
stale[bot]commented, Jun 28, 2022

Still an active issue, got it! Removing stale label.

1reaction
stale[bot]commented, Jun 26, 2022

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Significant Digits > Implementing Cisco Unified ...
The Significant Digits feature instructs CUCM to analyze the configured number of digits (from right to left) of the called number for incoming ......
Read more >
Specifying a number of significant digits? · Issue #194 - GitHub
First, this has been a very handy library. I would like to limit the number of significant digits to 3 such that: $12600...
Read more >
Enhancement Details: Setting the Display of Significant Digits
Setting the Display of Significant Digits. The detail setup option, dim_trail_zero_max_places, sets the number of decimal places when trailing zeroes are used ...
Read more >
Solved: CVP Sig Disgit - Cisco Community
Solution Using Significant Digits / Preprend Digits feature in CVP Call Server. 1. Call comes from INGRESS Site A with DID Number 19777...
Read more >
Setting the Significant Digits of Numbers and the Rounding ...
You can set the significant digits of numbers and the rounding method for the following fields: Number; Calculated (if the date format is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found