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

 $ top -E g

From the top help:

 -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.

OS: Ubuntu 20.04