mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-23 01:38:56 +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:
parent
3e924e2a37
commit
c8fadff9b1
Notes:
sideshowbarker
2024-07-17 03:30:41 +09:00
Author: https://github.com/kuzux
Commit: c8fadff9b1
Pull-request: https://github.com/SerenityOS/serenity/pull/16410
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/LucasChollet
Reviewed-by: https://github.com/ldm5180
2 changed files with 36 additions and 14 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue