Start New Discussion within our Software Development Community

Convert 1000000 into 1,000,000 using a perl regexp.

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

sub commify {
   (my $num = shift) =~ s/\G(\d{1,3})(?=(?:\d\d\d)+(?:\.|$))/$1,/g; 
   return $num; 
}
The article starter has earned a lot of community kudos, and such articles offer a bounty for quality replies.