|
|
| laziness, impatience, and hubris | |
| PerlMonks |
RE: RE: regexp for adding commas to a numberby AltBlue (Chaplain) |
| on Aug 17, 2000 at 19:45 UTC ( [id://28363]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
great regex! me too have forgoten about the look-ahead assertion :(
my function that does number beautifying has no less than 8 lines :((
$number =~ s/(?<!\.\d)(\d)(?=(\d{3})+(\D|$))/$1,/g;
couldn't think at anything better now.. maybe you have another bright idea for this too o=) so, after inserting your wizcraft, my lame tool looks something like this:
--
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||