]> wagnertech.de Git - kivitendo-erp.git/blobdiff - SL/Form.pm
sub round_amount schnedet nun anhängende Nullen automatisch ab.
[kivitendo-erp.git] / 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();