Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: How do I add commas to a number?

by Fastolfe (Vicar)
on Nov 09, 2000 at 23:21 UTC ( [id://40783]=note: print w/replies, xml ) Need Help??


in reply to How do I add commas to a number?

See perlfaq5: How can I output my numbers with commas added?. In addition, that FAQ apparently used to include the following, contributed by Andrew Johnson, as well:
sub commify { my $input = shift; $input = reverse $input; $input =~ s/(\d\d\d)(?=\d)(?!\d*\.)/$1,/g; return reverse $input; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://40783]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-26 00:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found