mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-12 08:10:07 +00:00
printHumanReadableSize should be able to process floats.
This commit is contained in:
parent
6cec4ce400
commit
2809000f9c
1 changed files with 3 additions and 2 deletions
|
@ -180,7 +180,8 @@ function print_icon() {
|
||||||
}
|
}
|
||||||
|
|
||||||
printSizeHumanReadable() {
|
printSizeHumanReadable() {
|
||||||
local size=$1
|
typeset -F 2 size
|
||||||
|
size="$1"+0.00001
|
||||||
local extension
|
local extension
|
||||||
extension=(B K M G T P E Z Y)
|
extension=(B K M G T P E Z Y)
|
||||||
local index=1
|
local index=1
|
||||||
|
@ -195,7 +196,7 @@ printSizeHumanReadable() {
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while (( (size / 1024) > 0 )); do
|
while (( (size / 1024) > 0.1 )); do
|
||||||
size=$(( size / 1024 ))
|
size=$(( size / 1024 ))
|
||||||
index=$(( index + 1 ))
|
index=$(( index + 1 ))
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue