The transliteration (tr) operator could also be used here to avoid the full overhead of regular expressions.
use strict; use warnings; my $grossAmt = "12,345,678.9"; $grossAmt =~ tr/,//d; $grossAmt = sprintf('%.2f', $grossAmt); print $grossAmt, $/; __END__ output: 12345678.90
In reply to Re: Removing comma's from int (numbers)
by farang
in thread Removing comma's from int (numbers)
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |