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

Fix battery string formatting #466

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Joan-rv
Copy link

@Joan-rv Joan-rv commented Feb 11, 2025

In modern versions of Lua, formatting a float with %d is not allowed (see https://stackoverflow.com/questions/31577104/lua-format-string-cant-format-float-as-decimal-d-as-of-5-3). This PR fixes it by using %.0f. This technically changes the behavior because instead of truncating, it rounds the number, but there is no significant difference in my opinion.

@Ryuno-Ki
Copy link
Contributor

Looks like we use the old pattern in several widgets. Good to know that they should be updated.

@streetturtle Do you prefer that to happen one at a time or all of them at once?

(Depending on the answer we might need new issues - which could be Good First ones)

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