You can use the command line option `E` to specify the memory scaling, for example in gigabytes:

 $ top -E g

From `man top`:

 -E :Extend-Memory-Scaling as: -E k | m | g | t | p | e
 Instructs top to force summary area memory to be scaled as:
 k - kibibytes
 m - mebibytes
 g - gibibytes
 t - tebibytes
 p - pebibytes
 e - exbibytes

 Later this can be changed with the `E' command toggle.

The `-e` option can be used with the same options to change the values in the task list.

OS: Ubuntu 20.04 and RHEL 9