From efc260398df0f3a9ecd36415b277c43e0c97fea7 Mon Sep 17 00:00:00 2001 From: Udo Spallek Date: Thu, 22 Dec 2005 13:46:56 +0000 Subject: [PATCH] =?utf8?q?Workaround=20f=C3=BCr=20Rundungsfehler,=20die=20?= =?utf8?q?da=20heraus=20entstehen,=20dass=20keine=20$places=20beim=20Aufru?= =?utf8?q?f=20von=20$form->format=5Famount=20angegeben=20ist.=20L=C3=B6sun?= =?utf8?q?g:=20Es=20wird=20auf=20die=20Anzahl=20der=20Stellen=20gerundet,?= =?utf8?q?=20die=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