mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-13 01:08:41 -09:00
Use kB instead of KB in --si mode
Backport of db96bc698c from the Zig
branch.
This commit is contained in:
parent
b4b82d96a3
commit
61feee5657
2 changed files with 2 additions and 2 deletions
2
ncdu.1
2
ncdu.1
|
|
@ -210,7 +210,7 @@ when given twice it will also add
|
||||||
thus ensuring that there is no way to modify the file system from within
|
thus ensuring that there is no way to modify the file system from within
|
||||||
.Nm .
|
.Nm .
|
||||||
.It Fl \-si , \-no\-si
|
.It Fl \-si , \-no\-si
|
||||||
List sizes using base 10 prefixes, that is, powers of 1000 (KB, MB, etc), as
|
List sizes using base 10 prefixes, that is, powers of 1000 (kB, MB, etc), as
|
||||||
defined in the International System of Units (SI), instead of the usual base 2
|
defined in the International System of Units (SI), instead of the usual base 2
|
||||||
prefixes (KiB, MiB, etc).
|
prefixes (KiB, MiB, etc).
|
||||||
.It Fl \-disk\-usage , \-apparent\-size
|
.It Fl \-disk\-usage , \-apparent\-size
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ float formatsize(int64_t from, const char **unit) {
|
||||||
float r = from;
|
float r = from;
|
||||||
if (si) {
|
if (si) {
|
||||||
if(r < 1000.0f) { *unit = " B"; }
|
if(r < 1000.0f) { *unit = " B"; }
|
||||||
else if(r < 1e6f) { *unit = "KB"; r/=1e3f; }
|
else if(r < 1e6f) { *unit = "kB"; r/=1e3f; }
|
||||||
else if(r < 1e9f) { *unit = "MB"; r/=1e6f; }
|
else if(r < 1e9f) { *unit = "MB"; r/=1e6f; }
|
||||||
else if(r < 1e12f){ *unit = "GB"; r/=1e9f; }
|
else if(r < 1e12f){ *unit = "GB"; r/=1e9f; }
|
||||||
else if(r < 1e15f){ *unit = "TB"; r/=1e12f; }
|
else if(r < 1e15f){ *unit = "TB"; r/=1e12f; }
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue