From a98fce08968febe7395b30f15f070f400da089ed Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner@archlinux.org>
Date: Sun, 6 May 2012 18:27:43 -0400
Subject: scripts/library: add size_to_human

This function is the reverse of human_to_size, and converts integer byte
sizes to human readable SI prefixed values.

A logical extension of this might be to mimic the formatter that pacman
uses and allow a second argument to be passed in which can coerce the
size, rather than reducing until the unit count is below 1024.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
---
 scripts/library/README | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'scripts/library/README')

diff --git a/scripts/library/README b/scripts/library/README
index 44748ee2..0fa0f847 100644
--- a/scripts/library/README
+++ b/scripts/library/README
@@ -35,3 +35,7 @@ successful, the converted byte value is written to stdout and the function
 returns 0. If an error occurs, nothing in written and the function returns 1.
 Results may be inaccurate when using a broken implementation of awk, such
 as mawk or busybox awk.
+
+size_to_human.sh:
+The reverse of human_to_size, this function takes an integer byte size and
+prints its in human readable format, with SI prefixes (e.g. MiB, TiB).
-- 
cgit v1.2.3-70-g09d2