in reply to Formatting a number
sub commafy { my $num = reverse shift; my @threes = $num =~ /(.{1,3})/g; return scalar reverse join ',', @threes; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Formatting a number
by jwkrahn (Abbot) on Oct 16, 2006 at 19:19 UTC |