in reply to Removing comma's from int (numbers)
Perl nows _ as such a separator, so s/,/_/g should already solves the issue.
Sorry, further tests showed that this doesn't work in strings only for literal numbers.
Just stick with s/,//g
DB<123> $x="1,234,567.99" => "1,234,567.99" DB<124> $x =~ s/,//g => 2 DB<125> sprintf('%.2f', $x); => "1234567.99"
Cheers Rolf
( addicted to the Perl Programming Language)
|
|---|