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

Add small_formatting argument to file_size #692

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

zwimer
Copy link

@zwimer zwimer commented Nov 2, 2024

Fixes: #691 by adding in a small_formatting argument which handles formatting when value is small enough that its suffix would be B, Byte, or Bytes.

@staticdev
Copy link
Owner

@zwimer thanks for your contribution. Could you please add the necessary tests so i can approve it?

src/human_readable/files.py Outdated Show resolved Hide resolved
@zwimer
Copy link
Author

zwimer commented Nov 5, 2024

I added test cases and noticed that among all the suffixes, there was one kB where everything else was capitalized it so I fixed that by changing it to KB.

@zwimer zwimer requested a review from staticdev November 25, 2024 19:00
@zwimer
Copy link
Author

zwimer commented Dec 13, 2024

@staticdev Is there anything else I can do to help get this merged?

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.

file_size option to display bytes as int when size < 1000
2 participants