in reply to Number format
Not built-in....
Update: As FunkyMonk noted (types faster than I): </update>my $text = 12345678.9; commify($text); print "\n |$text|\n"; # after Perl Cookbook recipe 2.17 sub commify { my $text = reverse $text; $text =~ s/(\d\d\d)(?=\d)(?!\d*\.)/$1,/g; print "In the sub: " . reverse $text . "\n"; }
FWIW, searching for "commafy" will also lead you to a thread with a useful node ...and, there's help at the ends of your fingers as well:
see perldoc -q comma.
|
|---|