Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rounding to 0 decimals? #29

Closed
cromelex opened this issue Jul 25, 2022 · 3 comments
Closed

Rounding to 0 decimals? #29

cromelex opened this issue Jul 25, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@cromelex
Copy link

Hi,

I have my set up with round: 0, however I have some entities showing with a single decimal.

Some of my lights will report sometimes a residual 0.4W or 0.1W, I was hoping to dismiss them by using "round: 0", however it does not seem to be working? Ie, them keep showing on my chart despite the rounding being set to 0.

Thanks,

@cromelex cromelex added the bug Something isn't working label Jul 25, 2022
@MindFreeze
Copy link
Owner

This is intentional, because of #18 . If they were rounded to 0 decimals, it would say 0W, and if it is 0, then it shouldn't be displayed and you would wonder where that 0.4 went. Or if it is displayed as 0W, you would wonder why it is displayed but other zero values are not. So for values that would round to zero we round to the first significant digit. Ex 0.0027 would show as 0.003

I have to add a note in the docs about this.

@cromelex
Copy link
Author

Thanks for the clarification, I understand now, seems logical.

@gsemet
Copy link

gsemet commented Aug 26, 2022

I would recommend to do something like 0.0027 -> <0.01 (round to 2 dec). This limits the number of character. For instance 0.0000000027 will takes a huge among of space

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants