Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Change the automatic scaling of data quantities in stats to 1 d.p.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhys Smith committed Oct 29, 2016
1 parent 6a80bfc commit 82893a2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions utilities/stats-generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@
bytestohr()
{
value=$1
valueint=$1
i=0
suffix=" KMGTPEZY"
while [ $value -gt 1024 ]; do
while [ $valueint -gt 1024 ]; do
i=$((i+1))
value=$((value/1024))
valueint=$((valueint/1024))
value=$(echo "scale=1;$value/1024" | bc)
done
echo $value ${suffix:$i:1}B
}
Expand Down

0 comments on commit 82893a2

Please sign in to comment.