From cf3bfc270056e67b6ce0d5d152f0d7718ddb81f1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stephan=20K=C3=B6hler?= Date: Fri, 30 Dec 2005 12:35:00 +0000 Subject: [PATCH] =?utf8?q?Merge=20von=20705=20aus=20unstable:=20format=5Fa?= =?utf8?q?mount=20Workaround=20f=C3=BCr=20Rundungsfehler,=20die=20da=20her?= =?utf8?q?aus=20entstehen,=20dass=20keine=20$places=20beim=20Aufruf=20von?= =?utf8?q?=20$form->format=5Famount=20angegeben=20ist.=20L=C3=B6sung:=20Es?= =?utf8?q?=20wird=20auf=20die=20Anzahl=20der=20Stellen=20gerundet,=20die?= =?utf8?q?=20eingegeben=20wurde.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Form.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SL/Form.pm b/SL/Form.pm index a0fa96a2c..c5a30bf78 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -519,6 +519,12 @@ sub format_amount { $main::lxdebug->enter_sub(); my ($self, $myconfig, $amount, $places, $dash) = @_; + + #Workaround for $format_amount calls without $places + if (!defined $places){ + (my $dec) = ($amount =~ /\.(\d+)/); + $places = length $dec; + } if ($places =~ /\d/) { $amount = $self->round_amount($amount, $places); -- 2.20.1