Skip to content

enhance: tweak ToFileSize for readability #1551

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

Closed
wants to merge 1 commit into from

Conversation

NathanBaulch
Copy link
Contributor

The new file size format has too many significant digits for good readability, plus thousands separators would help for the raw byte count.
Also, is now a good time to start adding some unit tests?

Before: 15.103 KB (15465 B)
After:  15.1 KB (15,465 B)

Before: 491.268 KB (503058 B)
After:  491 KB (503,058 B)

Before: 1.465 MB (1536332 B)
After:  1.46 MB (1,536,332 B)

@NathanBaulch NathanBaulch force-pushed the tofilesize branch 2 times, most recently from d267d4c to 6fa5a9e Compare July 9, 2025 23:19
@love-linger
Copy link
Collaborator

I've pushed my implementation for this request which based on current culture

@love-linger love-linger self-assigned this Jul 10, 2025
@love-linger love-linger added the enhancement New feature or request label Jul 10, 2025
@NathanBaulch
Copy link
Contributor Author

Your implementation doesn't address this PR - too many digits in the formatted file size.
For example it now shows 491.268 KB when 491 KB is all the user needs to see. G3 is much better than N3 in this situation.

@NathanBaulch NathanBaulch deleted the tofilesize branch July 10, 2025 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants