summaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2015-09-20 21:33:50 +0300
committerDominik Ritter <dritter03@googlemail.com>2015-09-20 21:33:50 +0300
commit2809000f9c11a932464810ff73ecbb6ac02d2952 (patch)
tree13d20de1d9cc78587c021196bec59a4365a878c0 /powerlevel9k.zsh-theme
parent6cec4ce40059fe4b1450794f20f7ab5fbda0735d (diff)
printHumanReadableSize should be able to process floats.
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rw-r--r--powerlevel9k.zsh-theme5
1 files changed, 3 insertions, 2 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 86fc2c42..5fa56836 100644
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -180,7 +180,8 @@ function print_icon() {
}
printSizeHumanReadable() {
- local size=$1
+ typeset -F 2 size
+ size="$1"+0.00001
local extension
extension=(B K M G T P E Z Y)
local index=1
@@ -195,7 +196,7 @@ printSizeHumanReadable() {
done
fi
- while (( (size / 1024) > 0 )); do
+ while (( (size / 1024) > 0.1 )); do
size=$(( size / 1024 ))
index=$(( index + 1 ))
done