Skip to content

Conversation

danoh
Copy link
Contributor

@danoh danoh commented Nov 24, 2024

Current code, after fix from #1887, generates sometimes weird results. For example, for battery level 0.99 is the result 90.10000000000001, due to float conversions.

I propose a fix that rounds the result to one decimal place, which should be fine for battery levels expressed in percentages. Rounding to whole numbers might even work well in this case.

@zuckschwerdt
Copy link
Collaborator

I think users won't expect any more precision than a whole number, i.e. round(0).

@danoh
Copy link
Contributor Author

danoh commented Nov 25, 2024

agreed and changed the pull request

@zuckschwerdt zuckschwerdt merged commit cd9c40c into merbanan:master Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants