$amount = $p[0];
$amount .= $d[0].$p[1].(0 x ($places - length $p[1])) if ($places || $p[1] ne '');
- $amount = ($neg) ? "($amount)" : "$amount" if $dash =~ ?-?;
- $amount = ($neg) ? "$amount DR" : "$amount CR" if $dash =~ ?DRCR?;
- $amount = ($neg) ? "-$amount" : "$amount" if $dash =~ ??;
- reset;
+ $amount = do {
+ ($dash =~ /-/) ? ($neg ? "($amount)" : "$amount" ) :
+ ($dash =~ /DRCR/) ? ($neg ? "$amount DR" : "$amount CR" ) :
+ ($neg ? "-$amount" : "$amount" ) ;
+ };
$main::lxdebug->leave_sub(2);
return $amount;