Alone, each of these work. Together, the number gets jumbled. Any idea as to why?
sub numfix { my $num = shift; 1 while $num =~ s/^([-+]?\d+)(\d{3})/$1,$2/; $num = sprintf("%.2f", $num); return $num; }
In reply to adding comma and two decimals by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |