in reply to Memeory usage output KB to MB conversion

You may be interested in Number::Bytes::Human or Number::Format from CPAN. Never used the latter personally but it looks like it has some support for "unformatting" numbers which you could use to parse your input and then reformat things back out with whatever different suffix and/or commaification. I have a shell function using the former that I keep on hand for hyoomaning up arbitrary numbers in the shell.

format_bytes () { perl -MNumber::Bytes::Human=format_bytes -lE 'for( @ARGV ) { say for +mat_bytes( $_ ); }' "$@" }

The cake is a lie.
The cake is a lie.
The cake is a lie.