mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 05:20:02 +08:00
fix: Progress calculation (#799)
This commit is contained in:
parent
64975557c2
commit
77ac73666e
@ -28,7 +28,7 @@ do
|
|||||||
if [ -z "$total" ] || [[ "$total" == "0" ]]; then
|
if [ -z "$total" ] || [[ "$total" == "0" ]]; then
|
||||||
size=$(numfmt --to=iec --suffix=B "$bytes" | sed -r 's/([A-Z])/ \1/')
|
size=$(numfmt --to=iec --suffix=B "$bytes" | sed -r 's/([A-Z])/ \1/')
|
||||||
else
|
else
|
||||||
size=$(printf '%.1f\n' "$((bytes*100*100/total))e-2")
|
size="$(echo "$bytes" "$total" | awk '{printf "%.1f", $1 * 100 / $2}')"
|
||||||
size="$size%"
|
size="$size%"
|
||||||
fi
|
fi
|
||||||
echo "${body//(\[P\])/($size)}"> "$info"
|
echo "${body//(\[P\])/($size)}"> "$info"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user