1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:47:35 +00:00

AK: Add a human_readable_quantity helper to NumberFormat.h

This can be used for displaying large quantities that are not measured
in bytes in a more human-readable format.
This commit is contained in:
Arda Cinar 2022-12-10 12:01:10 +03:00 committed by Sam Atkins
parent 3e924e2a37
commit c8fadff9b1
2 changed files with 36 additions and 14 deletions

View file

@ -10,7 +10,10 @@
namespace AK {
// TODO: Add an optional base here for binary vs si units
DeprecatedString human_readable_size(u64 size);
DeprecatedString human_readable_quantity(u64 quantity, StringView unit = "B"sv);
DeprecatedString human_readable_size_long(u64 size);
DeprecatedString human_readable_time(i64 time_in_seconds);
DeprecatedString human_readable_digital_time(i64 time_in_seconds);
@ -19,6 +22,7 @@ DeprecatedString human_readable_digital_time(i64 time_in_seconds);
#if USING_AK_GLOBALLY
using AK::human_readable_digital_time;
using AK::human_readable_quantity;
using AK::human_readable_size;
using AK::human_readable_size_long;
using AK::human_readable_time;