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

file_size option to display bytes as int when size < 1000 #691

Open
zwimer opened this issue Nov 2, 2024 · 1 comment · May be fixed by #692
Open

file_size option to display bytes as int when size < 1000 #691

zwimer opened this issue Nov 2, 2024 · 1 comment · May be fixed by #692

Comments

@zwimer
Copy link

zwimer commented Nov 2, 2024

Right now file_size(10) spits back 10.0 Bytes by default. Users can adjust formatting, however, there is no option to differentiate between when the number of bytes is small enough that the Byte or Bytes suffix is used. An option for this should be added.

With this option enabled (ideally by default):
Ex:
file_size(1) could print 1 Byte
file_size(10) could print 10 Bytes
file_size(1000) could print 1.0 kB

@zwimer
Copy link
Author

zwimer commented Nov 2, 2024

This makes logical sense since you cannot have a decimal number of bytes in a file (which the function currently accepts given that value is defined as an int).

@zwimer zwimer linked a pull request Nov 2, 2024 that will close this issue
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 a pull request may close this issue.

1 participant