Change output format of "top" command in Mac OS for memory usage?
A bit verbose, but the following awk snippet does this

$ echo 'PhysMem: 5490M used (2569M wired), 11G unused.' \
  | awk 'BEGIN {S["G"]=1024; S["M"]=1} 
         /PhysMem:/ {U=substr($2, 1, length($2)-1) * S[substr($2, length($2))];
                     N=substr($6, 1, length($6)-1) * S[substr($6, length($6))];
                     printf("%.2fG / %.2fG\n", U/1024, (N+U) / 1024)}'


5.36G / 16.36G