mirror of
https://github.com/NixOS/nix
synced 2025-06-27 00:11:17 +02:00
Move printSize() into libutil
Also always include the unit (i.e. "MiB" instead of "M").
This commit is contained in:
parent
dbe1b51580
commit
5314430437
4 changed files with 26 additions and 16 deletions
|
@ -137,6 +137,12 @@ N string2IntWithUnitPrefix(std::string_view s)
|
|||
throw UsageError("'%s' is not an integer", s);
|
||||
}
|
||||
|
||||
/**
|
||||
* Pretty-print a byte value, e.g. 12433615056 is rendered as `11.6
|
||||
* GiB`.
|
||||
*/
|
||||
std::string renderSize(uint64_t value);
|
||||
|
||||
/**
|
||||
* Parse a string into a float.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue