I need a script that converts a number from bytes to GB (not GiB) and rounds the result to 2 decimal places. How would I go about doing this?
Thanks.
$ n=1832985293598283
$ echo $(echo "scale=2; $n/1000000000" | bc -l)
1832985.29
$
Tells bc to calculate $n divided by a billion, with two decimals. bc should be available almost everywhere.