1 package App
::HomeBank2Ledger
::Util
;
2 # ABSTRACT: Miscellaneous utility functions
7 use Exporter
qw(import);
9 our $VERSION = '9999.999'; # VERSION
11 our @EXPORT_OK = qw(commify rtrim);
15 $commified = commify
($num);
16 $commified = commify
($num, $comma_char);
18 Just another commify subroutine
.
24 my $comma = shift || ',';
26 my $str = reverse $num;
27 $str =~ s/(\d\d\d)(?=\d)(?!\d*\.)/$1$comma/g;
29 return scalar reverse $str;
34 $trimmed_str = rtrim
($str);