Round percentage in Shell Script
item=30
total=70
percent=$(awk "BEGIN { pc=100*${item}/${total}; i=int(pc); print (pc-i<0.5)?i:i+1 }")
echo $percent
43
---
used = 30
total = 70
percentage=$(awk "BEGIN { pc=100*${used}/${total}; i=int(pc); print (pc-i<0.5)?i:i+1 }")",
echo $percentage
wk: BEGIN { pc=100*15/; i=int(pc); print (pc-i<0.5)?i:i+1 }