From 2f0457b51f734fb1d6ed51e3f659e0ff28338eac Mon Sep 17 00:00:00 2001 From: DJ Mills Date: Mon, 8 Jan 2018 20:49:27 -0500 Subject: [PATCH] Fix suffixes in si() function --- bashlib/bashlib | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bashlib/bashlib b/bashlib/bashlib index b2fbc53..0fda806 100755 --- a/bashlib/bashlib +++ b/bashlib/bashlib @@ -333,9 +333,9 @@ min() { si() { local number=$1 - if (( number >= 1000000000000000 )); then printf '%dM' "$((number / 1000000000000000))" - elif (( number >= 1000000000000 )); then printf '%dM' "$((number / 1000000000000))" - elif (( number >= 1000000000 )); then printf '%dM' "$((number / 1000000000))" + if (( number >= 1000000000000000 )); then printf '%dP' "$((number / 1000000000000000))" + elif (( number >= 1000000000000 )); then printf '%dT' "$((number / 1000000000000))" + elif (( number >= 1000000000 )); then printf '%dG' "$((number / 1000000000))" elif (( number >= 1000000 )); then printf '%dM' "$((number / 1000000))" elif (( number >= 1000 )); then printf '%dk' "$((number / 1000))" else printf '%d' "$number"; fi