Json input script for converting bytes to GB and percentage?

Hi ,
I want to convert memory size and cpu usage into GB in dashboard , please help me with json input script for that

Please see my response to the same question here.