#!/bin/bash
if [ "$1" = "" ];then
  echo ""
  echo "Capacity loss calculator by TDGalea."
  echo ""
  echo "Calculates the amount of storage lost thanks to"
  echo "binary vs. decimal differences."
  echo "Expects input in Gigabyte."
  echo ""
  exit 0
fi

mbBin="$(expr $1 \* 1024)"
mbDec="$(expr $1 \* 1000)"
mbLos="$(expr $mbBin - $mbDec)"
gbLos="$(expr $mbLos / 1024)"

echo "$1 GB:"
echo "$mbBin MB, Binary."
echo "$mbDec MB, Decimal."
echo ""
echo "$mbLos MB loss."
echo "~ $gbLos GB loss."
exit 0

