Added commify.
This commit is contained in:
parent
d55f4f1c3c
commit
43b7820191
1 changed files with 8 additions and 1 deletions
|
|
@ -15,7 +15,14 @@ use strict;
|
||||||
use Tie::IxHash;
|
use Tie::IxHash;
|
||||||
|
|
||||||
our @ISA = qw(Exporter);
|
our @ISA = qw(Exporter);
|
||||||
our @EXPORT = qw(&randomizeArray &sortHashDescending &sortHash &isIn &randint &round);
|
our @EXPORT = qw(&commify &randomizeArray &sortHashDescending &sortHash &isIn &randint &round);
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
sub commify {
|
||||||
|
my $text = reverse $_[0];
|
||||||
|
$text =~ s/(\d\d\d)(?=\d)(?!\d*\.)/$1,/g;
|
||||||
|
return scalar reverse $text;
|
||||||
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub isIn {
|
sub isIn {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue