Json input script for converting bytes to GB and percentage?

Please see my response to the same question here.