logo

utils-std

Collection of commonly available Unix tools
commit: f05ec647c2727dd38eaaa8a7ac039b5fc253b144
parent 96f2b1b6061e55b08f70bab3d3e78e0ef9ae77eb
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Mon, 25 Mar 2024 22:32:44 +0100

lib/humanize: Add comment about how dtosi works

Diffstat:

Mlib/humanize.h3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/lib/humanize.h b/lib/humanize.h @@ -12,4 +12,7 @@ struct si_scale unsigned exponant; }; +// dtosi(num, iec) => num ≈ number*scale^exponant where scale == iec ? 1024 : 1000 +// SI scale returns prefix values like k, M, G, … +// IEC scale returns prefix values like KiB, MiB, GiB, … struct si_scale dtosi(double num, bool iec);