It was Thursday, July 03, 2003 when Robert Citek took the soap box, saying: : : Hello all, : : I want to format a number so that it has commas as a separator. Here's the : code I came up with: : : my $num=12345678; : print scalar reverse( join(",", grep( /./ ,split : (/(...)/,reverse($num))))), "\n"; : : This works but was wondering if anyone might suggest a better method.
This is something folks always want to do. I suggest reading the FAQ on the subject. perldoc -q commas added Casey West -- If you put garbage in a computer nothing comes out but garbage. But this garbage, having passed through a very expensive machine, is somehow ennobled and none dare criticize it. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]