From 74f245fba8306d49caf19f9242f912912415068a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 29 May 2015 15:36:40 +0200 Subject: [PATCH] =?utf8?q?parse=5Famount:=20Bei=20amount=20undef=20sofort?= =?utf8?q?=200=20zur=C3=BCckgeben.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Form.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SL/Form.pm b/SL/Form.pm index e597786ec..583a0a1db 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -957,6 +957,8 @@ sub parse_amount { sub round_amount { my ($self, $amount, $places) = @_; + return 0 if !defined $amount; + # We use Perl's knowledge of string representation for # rounding. First, convert the floating point number to a string # with a high number of places. Then split the string on the decimal -- 2.20.1