From a4a6a0d34b965bec11b5a8de554a21fa7370a9d6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stephan=20K=C3=B6hler?= Date: Fri, 9 Jun 2006 13:51:24 +0000 Subject: [PATCH] Nachtag zu r1125, neue format_amount gab keine negativen Zahlen zurueck --- SL/Form.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/SL/Form.pm b/SL/Form.pm index b97833e77..9e55af355 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -627,10 +627,11 @@ sub format_amount { $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; -- 2.20.1