Format::LongNumber - Format long numbers to human readable view.
use Format::LongNumber; my $seconds = 3600*24*3 + 3600*4 + 60*5 + 11; print full_time($seconds); # '3d 4h 5m 11s' my $bytes = 123456789; print full_traffic($bytes); # '117Mb 755Kb 277b' print short_traffic($bytes); # '117.74Mb' # You may create custom formats by functions: # short_value(%grade_table, $value); # full_value(%grade_table, $value); # For example: my %my_time_grade = ( 3600*24 => " day ", 3600 => " hour ", 60 => " min ", 1 => " sec " ); print full_value(\%my_time_grade, 121); # '2 min 1 sec' );
full_value(\%grade_table, $total)
Abstract function of the final value
Params:
%grade_table - hash with dimensions, where the key is a value dimension, and the value is the symbol dimension $total - value to bring us to the desired mean
short_value(\%grade_table, $total)
Converts the given value only to the largest grade-value
Mikhail N Bogdanov <mbogdanov at cpan.org>
<mbogdanov at cpan.org>
1 POD Error
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head1'
To install Format::LongNumber, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Format::LongNumber
CPAN shell
perl -MCPAN -e shell install Format::LongNumber
For more information on module installation, please visit the detailed CPAN module installation guide.