In that code block are the exact actions you'd use in your command, however I'll attach a premade command as well.
There is another method(also included), which will work around the decimal bug:
Set decimal [STATE_RAMTOTAL] value to the converted value of {STATE_RAMTOTAL}
Set decimal [STATE_RAMTOTAL] to [STATE_RAMTOTAL] divided by 1073741824 (round to 2 decimal places)
Set decimal [STATE_RAMAVAILABLE] value to the converted value of {STATE_RAMAVAILABLE}
Set decimal [STATE_RAMAVAILABLE] to [STATE_RAMAVAILABLE] divided by 1073741824 (round to 2 decimal places)
Write '[Blue] Currenly there is {DEC:STATE_RAMAVAILABLE} of {DEC:STATE_RAMTOTAL} total RAM.' to log