config

OpenBSD system configuration
git clone git://jacobedwards.org/config
Log | Files | Refs | README

commit de37a7a33d3b663be336334a50bbd51565718601
parent 9404a3794bcc10d3b6e1e4cd46cae8b1027e621d
Author: Jacob R. Edwards <n/a>
Date:   Sun, 24 Apr 2022 19:35:44 -0500

Increase human.awk's precision

Diffstat:
Mlocal/bin/bin/human.awk | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/local/bin/bin/human.awk b/local/bin/bin/human.awk @@ -16,8 +16,8 @@ function tohuman(n) { for (i = START; n > MULT && i < MAX; ++i) - n /= MULT; - return i ? sprintf("%zu%c%c", n, SIZES[i], SUFX) : n; + n = (n / MULT) + (n % MULT / MULT) + return i ? sprintf("%.2f%c%c", n, SIZES[i], SUFX) : n; } BEGIN {