in reply to How do I add commas to a number?
sub addcommas{ my ($text)=@_; $text=reverse $text; $text=~s/(\d\d\d)(?=\d)(?!\d*\.)/$1,/g; $text=scalar reverse $text; return $text; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Answer: How do I add commas to a number?
by Anonymous Monk on Dec 12, 2001 at 20:39 UTC | |
by Biker (Priest) on Dec 12, 2001 at 20:49 UTC | |
|