]> wagnertech.de Git - kivitendo-erp.git/commitdiff
sub round_amount schnedet nun anhängende Nullen automatisch ab.
authorUdo Spallek <info@wissensvermittlung.com>
Thu, 27 Oct 2005 02:10:25 +0000 (02:10 +0000)
committerUdo Spallek <info@wissensvermittlung.com>
Thu, 27 Oct 2005 02:10:25 +0000 (02:10 +0000)
SL/Form.pm

index 712f655c2f9369753ca3c99c204c236fc04e353b..eeb470e7007b5d618c8eb84bcbc30bdab03256f1 100644 (file)
@@ -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();