diff --git a/ClosedXML/Excel/CalcEngine/Functions/MathTrig.cs b/ClosedXML/Excel/CalcEngine/Functions/MathTrig.cs index 512b609..c4e86ca 100644 --- a/ClosedXML/Excel/CalcEngine/Functions/MathTrig.cs +++ b/ClosedXML/Excel/CalcEngine/Functions/MathTrig.cs @@ -470,13 +470,13 @@ var digits = (Int32)(Double)p[1]; if (digits >= 0) { - return Math.Round(value, digits); + return Math.Round(value, digits, MidpointRounding.AwayFromZero); } else { digits = Math.Abs(digits); double temp = value / Math.Pow(10, digits); - temp = Math.Round(temp, 0); + temp = Math.Round(temp, 0, MidpointRounding.AwayFromZero); return temp * Math.Pow(10, digits); }