Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: regexp for adding commas to a number

by tenatious (Beadle)
on Aug 18, 2000 at 07:06 UTC ( [id://28425]=note: print w/replies, xml ) Need Help??


in reply to regexp for adding commas to a number

Out of Andrew Johnson's Elements of Perl Programming:
s/(\d{1,3}) (?= (?:\d\d\d)+ (?!\d) ) /$1,/gx;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-03-29 05:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found