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
Option for human-readable format #335
Comments
That sounds useful. Do you know if there are any localisation problems with that @arkel-s ? Im not across what happens in Europe enough to determine that. |
Oh yes, unfortunately there are many ways to write numbers, and no iso standard 😞 Random copy/paste: func LineCountDecimal(b int64) string {
const unit = 1000
if b < unit {
return fmt.Sprintf("%d", b)
}
div, exp := int64(unit), 0
for n := b / unit; n >= unit; n /= unit {
div *= unit
exp++
}
return fmt.Sprintf("%.1f %c", float64(b)/float64(div), "kMGTPE"[exp])
} |
Using an underscore also makes them more readable.
|
I might just make the decision to go with the US standard on this. Maybe with the option to modify it via a flag. |
First, thanks for this great tool!
For large code bases, the numerical output are hard to read, example:
It would be nice to get an option for human readable format, like 72.9 M (or 72.9e6)
The text was updated successfully, but these errors were encountered: