diff --git a/Koha/Number/Price.pm b/Koha/Number/Price.pm index e9a6aa748e..a0f847d495 100644 --- a/Koha/Number/Price.pm +++ b/Koha/Number/Price.pm @@ -19,6 +19,7 @@ package Koha::Number::Price; use Modern::Perl; +use Math::BigFloat; use Number::Format; use C4::Context; use Koha::Acquisition::Currencies; @@ -83,12 +84,7 @@ sub round { my $format_params = $self->_format_params; - # To avoid the system to crash, we will not format big number - # We divide per 100 because we want to keep the default DECIMAL_DIGITS (2) - # error - round() overflow. Try smaller precision or use Math::BigFloat - return $self->value if $self->value > Number::Format::MAX_INT/100; - - return Number::Format->new(%$format_params)->round($self->value); + return Number::Format->new(%$format_params)->round( Math::BigFloat->new( $self->value ) )->bdstr(); } sub _format_params {