]> wagnertech.de Git - kivitendo-erp.git/commitdiff
Darstellungsfehler bei Ganzzahlen behoben. Vorher wurde bspw. '2' als '2,' dargestell...
authorUdo Spallek <info@wissensvermittlung.com>
Thu, 27 Oct 2005 18:40:40 +0000 (18:40 +0000)
committerUdo Spallek <info@wissensvermittlung.com>
Thu, 27 Oct 2005 18:40:40 +0000 (18:40 +0000)
SL/Form.pm

index 80c1ef72cbe6f4aea7d8f9968b526b5f22fecfc3..bfe8e464472c9a7b498143b47e651c88fbc175a1 100644 (file)
@@ -540,19 +540,19 @@ sub format_amount {
         $amount =~ s/\d{3,}?/$&,/g;
         $amount =~ s/,$//;
         $amount = join '', reverse split //, $amount;
         $amount =~ s/\d{3,}?/$&,/g;
         $amount =~ s/,$//;
         $amount = join '', reverse split //, $amount;
-        $amount .= "\.$dec".$fillup;
+        $amount .= "\.$dec".$fillup if ($places ne '' && $places*1 != 0);
       }
 
       if ($myconfig->{numberformat} eq '1.000,00') {
         $amount =~ s/\d{3,}?/$&./g;
         $amount =~ s/\.$//;
         $amount = join '', reverse split //, $amount;
       }
 
       if ($myconfig->{numberformat} eq '1.000,00') {
         $amount =~ s/\d{3,}?/$&./g;
         $amount =~ s/\.$//;
         $amount = join '', reverse split //, $amount;
-        $amount .= ",$dec" .$fillup;
+        $amount .= ",$dec".$fillup if ($places ne '' && $places*1 != 0);
       }
 
       if ($myconfig->{numberformat} eq '1000,00') {
         $amount = "$whole";
       }
 
       if ($myconfig->{numberformat} eq '1000,00') {
         $amount = "$whole";
-        $amount .= ",$dec" .$fillup;
+        $amount .= ",$dec" .$fillup if ($places ne '' && $places*1 != 0);
       }
 
       if ($dash =~ /-/) {
       }
 
       if ($dash =~ /-/) {
@@ -610,14 +610,15 @@ sub round_amount {
   # Descr. http://de.wikipedia.org/wiki/Rundung
   # Inspired by 
   # http://www.perl.com/doc/FAQs/FAQ/oldfaq-html/Q4.13.html
   # Descr. http://de.wikipedia.org/wiki/Rundung
   # Inspired by 
   # http://www.perl.com/doc/FAQs/FAQ/oldfaq-html/Q4.13.html
-  # Version 1.0 try to solve Bug: 189
+  # Solves Bug: 189
   # Udo Spallek
   $amount       = $amount * (10 ** ($places));
   $round_amount = int($amount + .5 * ($amount <=> 0))/(10**($places));
   # Udo Spallek
   $amount       = $amount * (10 ** ($places));
   $round_amount = int($amount + .5 * ($amount <=> 0))/(10**($places));
-  
+
   $main::lxdebug->leave_sub();
 
   return $round_amount;
   $main::lxdebug->leave_sub();
 
   return $round_amount;
+  
 }
 
 
 }