summaryrefslogtreecommitdiff
path: root/Userland/df.cpp
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2020-08-15 13:55:00 -0400
committerAndreas Kling <kling@serenityos.org>2020-08-16 16:33:28 +0200
commit430b265cd45167fb2dca2323ea5f5b910be00a1d (patch)
tree703e3fb9cb2f752b8a85f6cab52698b94576abc0 /Userland/df.cpp
parenta68650a7b41f0bb99d26a1405baaca33c1dfbcb6 (diff)
downloadserenity-430b265cd45167fb2dca2323ea5f5b910be00a1d.zip
AK: Rename KB, MB, GB to KiB, MiB, GiB
The SI prefixes "k", "M", "G" mean "10^3", "10^6", "10^9". The IEC prefixes "Ki", "Mi", "Gi" mean "2^10", "2^20", "2^30". Let's use the correct name, at least in code. Only changes the name of the constants, no other behavior change.
Diffstat (limited to 'Userland/df.cpp')
-rw-r--r--Userland/df.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Userland/df.cpp b/Userland/df.cpp
index a8a6595867..84681ee443 100644
--- a/Userland/df.cpp
+++ b/Userland/df.cpp
@@ -58,13 +58,13 @@ static String number_string_with_one_decimal(float number, const char* suffix)
static String human_readable_size(size_t size)
{
- if (size < 1 * KB)
+ if (size < 1 * KiB)
return String::number(size);
- if (size < 1 * MB)
- return number_string_with_one_decimal((float)size / (float)KB, "K");
- if (size < 1 * GB)
- return number_string_with_one_decimal((float)size / (float)MB, "M");
- return number_string_with_one_decimal((float)size / (float)GB, "G");
+ if (size < 1 * MiB)
+ return number_string_with_one_decimal((float)size / (float)KiB, "K");
+ if (size < 1 * GiB)
+ return number_string_with_one_decimal((float)size / (float)MiB, "M");
+ return number_string_with_one_decimal((float)size / (float)GiB, "G");
}
int main(int argc, char** argv)