From: Udo Spallek Date: Thu, 27 Oct 2005 02:16:29 +0000 (+0000) Subject: Version2 X-Git-Tag: release-2.4.0^2~495 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=7e5216e842111fc73b6d7fe62b16337ccc720939;p=kivitendo-erp.git Version2 --- diff --git a/SL/Form.pm b/SL/Form.pm index eeb470e70..251b0485e 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -615,11 +615,11 @@ sub round_amount { $amount = $amount * (10 ** ($places)); $round_amount = int($amount + .5 * ($amount <=> 0))/(10**($places)); - do { - $round_amount =~ s/(0|\.)$//g; - $places--; - } while ($places > 0); - + while ($places > 0 && $round_amount=~ /\./){ + $round_amount =~ s/[0]$//g; + $places--; + } ; + $round_amount =~ s/\.$//g; $main::lxdebug->leave_sub(); return $round_amount;