From: Udo Spallek Date: Thu, 27 Oct 2005 02:10:25 +0000 (+0000) Subject: sub round_amount schnedet nun anhängende Nullen automatisch ab. X-Git-Tag: release-2.4.0^2~496 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=999fedbd9ddf7f73d468776559edfcc34f7aafdf;p=kivitendo-erp.git sub round_amount schnedet nun anhängende Nullen automatisch ab. --- diff --git a/SL/Form.pm b/SL/Form.pm index 712f655c2..eeb470e70 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -614,6 +614,11 @@ sub round_amount { # Udo Spallek $amount = $amount * (10 ** ($places)); $round_amount = int($amount + .5 * ($amount <=> 0))/(10**($places)); + + do { + $round_amount =~ s/(0|\.)$//g; + $places--; + } while ($places > 0); $main::lxdebug->leave_sub();