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

Support fractional values #51

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

Conversation

bbarenblat
Copy link
Contributor

Treat values passed on the command line as floats instead of longs. This allows you to specify fractional percentages (and fractional absolute values, too, though they’ll just be rounded down, so they’re not particularly useful).

Report the display brightness as a percentage with two decimal places rather than zero. To ensure backward compatibility in machine-readable mode, report the high-precision percentage in a new field rather than replacing the existing field. This does cause some redundancy in the output, but that’s better than breaking scripts that assume the 4th field is an integer followed by “%”.

Closes: #50

Treat values passed on the command line as floats instead of longs.
This allows you to specify fractional percentages (and fractional
absolute values, too, though they’ll just be rounded down, so they’re
not particularly useful).

Report the display brightness as a percentage with two decimal places
rather than zero. To ensure backward compatibility in machine-readable
mode, report the high-precision percentage in a new field rather than
replacing the existing field. This does cause some redundancy in the
output, but that’s better than breaking scripts that assume the 4th
field is an integer followed by “%”.

Closes: Hummer12007#50
@Hummer12007
Copy link
Owner

Hummer12007 commented May 14, 2020

Would this code produce well-formed CSVs when the locale has comma as the decimal separator?

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.

Support fractional percentages
2 participants