⭐ in reply to How do I add commas to a number?
sub commify { my $input = shift; $input = reverse $input; $input =~ s/(\d\d\d)(?=\d)(?!\d*\.)/$1,/g; return reverse $input; } [download]