in reply to GB, MB, KB and on..
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.my $kb = 1024 * 1024; # set to 1 Gb my $mb = $kb >> 10; my $gb = $mb >> 10; print "$kb kb = $mb mb = $gb gb\n"; __END__ 1048576 kb = 1024 mb = 1 gb
|
|---|