Hi,
when using "df -h" the output will use the largest unit that doesn't
have a leading 0. This often results in quite imprecise output, e.g.
1.1T or 1.8G. It would be nice if instead it cout use the smallest
unit that use 4 or less characters (maybe even 5 if a "." is involved).
So the output would go
0 - 9999 0 - 9999
10.0k - 9999k or 10.00k - 9999k
10.0M - 9999M 10.00M - 9999M
10.0G - 9999G or 10.00G - 9999G
and so on. Extra points for adding a --precision=<num chars> instead
of hardcoding 4/5 chars.
MfG
Goswin
I'm struggling to think of a use case that requires 4 digits of precision on a terabyte filesystem. If you need to know the exact size, then get the size in bytes. Otherwise, it's probably close enough. Mike Stone
4 chars for the number, which would only be 1-2 digits of precision. As in 11.7G instead of 12G or 1750M instead of 1.8G. 4 digits of precision would indeed be too much. MfG Goswin
We already have at least two digits of precision and often three. Your 1750M *is* 4 digits of precision. And you said "maybe even 5 if a . is involved". But I'll restate to avoid the quibble: I'm struggling to think of a use case that requires 3 digits of precision on a terabyte filesystem. If you need to know the exact size, then get the size in bytes. Otherwise, it's probably close enough. ike stone