laziness, impatience, and hubris | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Divide by 1000? Are you selling disk drives? :-)
There is some debate about whether it's 1000 or 1024 but you should be consistent, whichever you choose. So if you have 1024B in a KB then you should have 1024KB in an MB and 1024 MB in a GB. There is(was?) a proposal that since kilo and mega and giga already mean 10^3, 10^6 and 10^9 in all other fields that they should also mean that in computers and that we should say kibibyte, mebibyte and gigibyte (gibibyte?) when we're talking about the 1024 based versions. Needless to say this didn't catch on. As for the original question, something like this would do the trick. I leave it as an excercise to fix the fact that 25 bytes comes out as 25.000B
In reply to Re^2: GB, MB, KB and on..
by fergal
|
|