laziness, impatience, and hubris | |
PerlMonks |
Re: GB, MB, KB and on..by Joost (Canon) |
on Jul 29, 2004 at 23:26 UTC ( [id://378544]=note: print w/replies, xml ) | Need Help?? |
Take advantage of the fact that 1 Gb = 1024 Mb, 1 Mb = 1024 Kb and 1024 = 2 ** 10:
Edit: after reading your post again, I'm afraid it doesn't really do what you want (though I think it's pretty elegant), because it will round down to the nearest integer.
In Section
Seekers of Perl Wisdom
|
|