LA.pm: Perl is money continued

Arkadiy Sudarikov asudarikov at xceed.com
Wed Oct 24 19:45:00 CDT 2001


$revenue=sprintf '%.2f', $revenue;

$revenue=reverse $revenue;

$revenue=~ s/(\d\d\d)(?=\d)(?!\d\d\.)/$1,/g;

$revenue=reverse $revenue;

Is this really the best way to do it? There GOTTA BE other way to do it =o)
I see how the regex works, it's good... It's just... reverse...



More information about the Losangeles-pm mailing list