The stupid question is the question not asked | |
PerlMonks |
Re: Memeory usage output KB to MB conversionby tomasz (Acolyte) |
on Jun 05, 2021 at 19:53 UTC ( [id://11133565]=note: print w/replies, xml ) | Need Help?? |
This should help you find a less chaotic direction. The code is not complete and some bits are not along your wish, but the code is plastic.
You need to improve the value transformation and commation-commification function (rc in the code). 1024 MB is 1073741824 bytes (1024 ** 3), not 1024 * 1000 * 1000. As for the comma or commas, there might be such a printf option. I'm not sure, but wouldn't be surprised. This function will also integrate nicely with translation to other measure bases (GB or whatever). I FORGOT: I used the -p switch on the command line instead of the -n. (That's where all the prints are.)
In Section
Seekers of Perl Wisdom
|
|