> What about being able to change the number of digits per grouping?
>
> The one use I can think of atm is for certain cryptographic
> methods that
> output lists of numbers in blocks of 5...
>
> big_number.commify(" ",5);
>
> Feel free to ignore this - I'm really bored :-)
me too :)
sub commify {
local $_ = shift;
my $c = shift || ",";
my $n = int(shift) || 3;
return $_ if $n<1;
1 while s/^([-+]?\d+)(\d{$n})/$1$c$2/;
return $_;
}
