From: Udo Spallek Date: Thu, 27 Oct 2005 18:40:40 +0000 (+0000) Subject: Darstellungsfehler bei Ganzzahlen behoben. Vorher wurde bspw. '2' als '2,' dargestell... X-Git-Tag: release-2.4.0^2~492 X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/commitdiff_plain/7247d23a2badb87bf894346ec5d211ac568f23ad Darstellungsfehler bei Ganzzahlen behoben. Vorher wurde bspw. '2' als '2,' dargestellt, nun wird richtig formatiert. --- diff --git a/SL/Form.pm b/SL/Form.pm index 80c1ef72c..bfe8e4644 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -540,19 +540,19 @@ sub format_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; - $amount .= ",$dec" .$fillup; + $amount .= ",$dec".$fillup if ($places ne '' && $places*1 != 0); } if ($myconfig->{numberformat} eq '1000,00') { $amount = "$whole"; - $amount .= ",$dec" .$fillup; + $amount .= ",$dec" .$fillup if ($places ne '' && $places*1 != 0); } 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 - # 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)); - + $main::lxdebug->leave_sub(); return $round_amount; + }