my $number = 123; $number =~ s/(\d)(?=(\d{3})+(\D|$))/$1\,/g; print $number;
I get no output from the print, almost as if $number if undef. If I use 1234 as the input, I get 1,234 out - which is right ..
That's with Perl 5.004.04 on Solaris .. maybe it's a version thing.
-- Foxcub
In reply to Re: (tye)Re: "Commifying" a number
by Tanalis
in thread "Commifying" a number
by Tanalis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |