my $number - 1000000;
$number = commify($number);

sub commify {
   (my $num = shift) =~ s/\G(\d{1,3})(?=(?:\d\d\d)+(?:\.|$))/$1,/g; 
   return $num; 
}
1
Contributor
1
Reply
2
Views
10 Years
Discussion Span
Last Post by KevinADC
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.