Files
Christian HesseandZen Dodd 041769d607 human-readable: standardise size and progress-rate formatting (#459)
* human-readable: do not add trailing space in output

Co-authored-by: Zen Dodd <mail@steadytao.com>

* human-readable: use dynamic precision length

Let's lower precision for huge numbers.

The output used to be:

  3.45M -> 46.73M -> 523.11M -> 1.24G -> ...

With this change the code always gives the three most significant digits:

  3.45M -> 46.7M -> 523M -> 1.24G -> ...

Co-authored-by: Zen Dodd <mail@steadytao.com>

* human-readable: also handle num < mult with the same code

... just make sure no precision is added.

Co-authored-by: Zen Dodd <mail@steadytao.com>

* human-readable: add an "i" to unit to indicate binary (1024) base

Co-authored-by: Zen Dodd <mail@steadytao.com>

* human-readable: also use it to format rate in progress

Let's also simplify the code for rate in progress, and benefit from
same functionality.

Co-authored-by: Zen Dodd <mail@steadytao.com>

* human-readable: append suffix "B" for byte to ofs...

... and also fix the formatting in man page.

Co-authored-by: Zen Dodd <mail@steadytao.com>

* human-readable: unbreak for do_big_dnum() with fract

Co-authored-by: Christian Hesse <mail@eworm.de>

* testsuite: cover human-readable output

---------

Co-authored-by: Zen Dodd <mail@steadytao.com>
2026-10-08 13:25:25 +10:00
..
2025-08-23 17:31:40 +10:00
2019-03-16 09:15:49 -07:00
2006-01-02 17:46:12 +00:00