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 712f655..eeb470e 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();