Posted on 2006-03-26 20:32:06-08 by jeunice
Suffix for plain bytes in format_bytes()
Number::Format has options for changing the KILO, MEGA, and GIGA formats for use with format_bytes(). That's good, as we greatly prefer 'KB', 'MB', and 'GB' to 'K', 'M', and 'G'. Unfortunately, it does not provide any mechanism for adding a bytes suffix to smaller quantities. Instead of having separate code to check for this possibility in my program, I have extended the Number::Format module to permit byte-level suffixes. I have added the new option BYTE_SUFFIX to handle this. The default is to do nothing, so that it will be compatible with the existing behavior. This forum doesn't seem to have an easy way of attaching a file, but the updated text is available from me at jeunice emailat illuminata emaildot com
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.