Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Re: Re: "Commifying" a number

by sauoq (Abbot)
on Dec 13, 2002 at 00:49 UTC ( [id://219478]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: "Commifying" a number
in thread "Commifying" a number

sauoq sighs.

True. It only works on integers. I should have said so.

How about this...

s/(\d+)/$_=$1;1while(s|(?<!\b)(\d{3})(?:\b)|,$1|);$_/e

:-P

-sauoq
"My two cents aren't worth a dime.";

Log In?
Username:
Password:

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

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

    No recent polls found