Converting Bytes

barbie on 2004-04-26T15:54:01

I had a need to convert between different Byte representations. Unfortunately I couldn't spot anything obvious on CPAN, so did my own thing. However, after a quick tidy up, some test scripts and a few extra files, I managed to create a nice little distribution.

So is Number::Convert::Bytes (pod here) worth uploading to CPAN or should I have called it Convert::Number::Bytes?


Number::Format

davorg on 2004-04-26T16:05:41

I think you want the "format_bytes" function from Number::Format.

Bits!

2shortplanks on 2004-04-26T16:22:34

Please to be adding methods for bits as well.

e.g.

$bytes->Kilobits
Of course it might be really interesting if you were to use overloading to help you here....

Re:Bits!

barbie on 2004-04-26T17:04:35

That'll be my fun exercise for tomorrow then :)

NIST Mode

brianiac on 2004-04-26T17:24:24

Out of completeness, NIST mode could be added fairly easily. ;)

Re:NIST Mode

bluto on 2004-04-26T17:42:30

I've been working in the storage industry for about 10 years, we have a 2 petabyte archive stored locally, and no one I know uses the SI units -- they're just lame. I'd say just boycott them. :-)