Chris wrote:
> 
> So to put it all together. I am able to re-format a money datatype in
> dollars to integer pennies with truncate/pad  like so
> 
> $amount = -11555;
> $amount = -11555.9999;
> $amount = -11555.9;
> $amount =~ s/(?<=\.\d\d)\d+$//;
> $amount .= ".00" unless $amount =~ tr/.//;
> $amount .= "0"   unless $amount =~ /\.\d\d$/;
> $amount =~ tr/[0-9][\-]//cd;

The tr/// operator does not use regular expressions.  The brackets []
will match literal brackets, they are not used as delimiters in tr///
content.

$amount =~ tr/0-9-//cd;

Or, if you _really_ want to use brackets:

$amount =~ tr[0-9-][]cd;


> print "$amount\n";



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to