X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/e358c9af31afc5d60840f615f3c81d7b2bf7ad94..73a78da630ce363f70062447dd82a8a0ece8cd89:/SL/Form.pm diff --git a/SL/Form.pm b/SL/Form.pm index 32064f3c0..b9263004b 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -947,10 +947,15 @@ sub parse_amount { } sub round_amount { - my ($self, $amount, $places) = @_; + my ($self, $amount, $places, $adjust) = @_; return 0 if !defined $amount; + if ($adjust) { + my $precision = $::instance_conf->get_precision || 0.01; + return $self->round_amount( $self->round_amount($amount / $precision, 0) * $precision, $places); + } + # 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