Skip Menu |

This queue is for tickets about the Number-Format CPAN distribution.

Report information
The Basics
Id: 125400
Status: new
Priority: 0/
Queue: Number-Format

People
Owner: Nobody in particular
Requestors: tlhackque [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: format_bytes options, documentation
format_bytes calls format_number internally, but does not export all it's options. Thus, format_bytes obeys the object's options that 'belong' to format_number. a) This is not clear in the documentation. b) I wanted format_bytes to produce trailing zeros (for a table). That is, the equivalent of format_number's $trailing_zeroes. I eventually found that creatng an extra object with decimal_fill => 1 was equivalent. It would be more convenient to have a 'trailing' ( or 'decimal_fill' ) option for format_bytes. This would provide a value for the call independent of the object/global variables' state. c) For the convenience of those who make multiple calls with the same (precision, unit,base,mode (and trailing) parameters, you might consider accepting a hashref for options. This would allow for more concise calls (and centralize options in the caller). E.g. my $opts = { mode => 'traditional, precision => 2, trailing => 1 }; $number->format_bytes( $n ); $number->format_bytes( $m ); ...