in reply to Formatting numbers with commas

I don't know a way to do so with sprintf...

Maybe the following might help you (about from perl-cookbook):

sub Commify { my $text = reverse $_[0]; $text =~ s/(\d\d\d)(?=\d)(?!\d*\.)/$1,/g; return scalar reverse $text; } # Commify

Best regards,
perl -le "s==*F=e=>y~\*martinF~stronat~=>s~[^\w]~~g=>chop,print"