-
Notifications
You must be signed in to change notification settings - Fork 286
Format numbers #706
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
Comments
Just throwing out another option: what would you think about formats like |
While I have nothing against that suggestion, I would not choose this due to it stripping away some "exactness" of the numbers at hand. (Let's ignore the Size in GiB) |
This feature would require to handle multiple formatting options (e.g. which thousands separator to use) and be able to detect the system local of the user (or use a cli flag to ask for the user's preference), |
TBH I'm not sure how necessary exactness is. This is just my opinion, but once billions of lines of code are reached, I wouldn't care if it's 3 billion, 3 billion and 1 hundred, or 3 billion and 1 thousand, I'd just care about the 3 or 4 most significant digits. If I'm showing off my repo, I'd be saying "look, over 3 billion lines of code!" not "look, 3 billion, 255 million, ..." 😆 As @o2sh points out different locales have different thousands separators. And even the placement of the separators can differ (not all cultures historically group numbers into thousands), so any formatting with separators would need to come from a library. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Well, the activity depends on what you ultimately decide on for this idea. |
Going through issues: since number format is a personal preference and/or localization issue, I think it should be a config option. So I'm going to suggest that #745 gets implemented before this. After that, I think the most reasonable thing is to offer some predefined named formatters that a user can pick in their config (defaulting to the "raw" format). |
I like this approach. |
Depends on how the config is implemented. Preferably, we don't have to duplicate much work. Honestly, we could make a "config" be purely a list of CLI args (I'm taking inspiration from I suppose I'm kind of contradicting myself. I just said to wait until config files are implemented, but now I'm kind of arguing it should be a CLI arg 🤣 If this approach is worth it, I wonder if a crate already exists for this 🤔 |
FWIW, it seems like We should probably use it to format numbers. I'm in favor of adding a CLI flag to allow the user to specify the format with a default to The library comes a with a feature that can automatically detect the OS's locale information but it does not seem like a good idea to use it:
|
Good news! I'm all in favor of using it to format numbers 👍 |
Hi @H4ckerxx44, can you check if #892 resolves your issue? |
As I am not home right now I can't really check, though it seems like this does exactly what I had in mind. Thanks for implementing it! |
Summary 💡
On larger code bases, the amount of
files
and the amount oflines of code
could become a bit unreadable due to the lacking formatting, my feature request would be to format thelines of code
,commits
as well as thefiles
datapoint like,15614
->15,614
or3255204307
->3,255,204,307
Motivation 🔦
That's 3 billlion lines of code, quite unreadable

The text was updated successfully, but these errors were encountered: