PropertiesWindow: Show the file size in a human readable format

This commit is contained in:
David Isaksson 2021-03-24 21:14:16 +01:00 committed by Andreas Kling
parent 17c0349d23
commit 3f9ac88c6e
Notes: sideshowbarker 2024-07-18 21:06:16 +09:00

View file

@ -26,6 +26,7 @@
#include "PropertiesWindow.h"
#include <AK/LexicalPath.h>
#include <AK/NumberFormat.h>
#include <AK/StringBuilder.h>
#include <LibDesktop/Launcher.h>
#include <LibGUI/BoxLayout.h>
@ -128,7 +129,7 @@ PropertiesWindow::PropertiesWindow(const String& path, bool disable_rename, Wind
}
}
properties.append({ "Size:", String::formatted("{} bytes", st.st_size) });
properties.append({ "Size:", human_readable_size_long(st.st_size) });
properties.append({ "Owner:", String::formatted("{} ({})", owner_name, st.st_uid) });
properties.append({ "Group:", String::formatted("{} ({})", group_name, st.st_gid) });
properties.append({ "Created at:", GUI::FileSystemModel::timestamp_string(st.st_ctime) });