From: PJ Fanning Date: Mon, 23 May 2022 14:13:56 +0000 (+0000) Subject: fix test issue X-Git-Tag: REL_5_2_3~309 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8508a5e86c8a56cc476b4e09f7c7e3845e93bd9d;p=poi.git fix test issue git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1901176 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/MathX.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/MathX.java index 2a42587987..6362ab461b 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/MathX.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/MathX.java @@ -21,6 +21,7 @@ import org.apache.poi.ss.util.NumberToTextConverter; import org.apache.poi.util.Internal; import java.math.BigDecimal; +import java.math.MathContext; import java.math.RoundingMode; /** @@ -277,7 +278,7 @@ final class MathX { @Internal public static double scaledRoundUsingBigDecimal(double xval, double multiplier, RoundingMode mode) { BigDecimal multiplierDecimal = BigDecimal.valueOf(multiplier); - BigDecimal bd = BigDecimal.valueOf(xval).divide(multiplierDecimal) + BigDecimal bd = BigDecimal.valueOf(xval).divide(multiplierDecimal, MathContext.DECIMAL128) .setScale(0, mode) .multiply(multiplierDecimal); return bd.doubleValue();