diff --git a/src/VirtoCommerce.CoreModule.Core/Currency/DefaultMoneyRoundingPolicy.cs b/src/VirtoCommerce.CoreModule.Core/Currency/DefaultMoneyRoundingPolicy.cs index 14d30517..1901cbf0 100644 --- a/src/VirtoCommerce.CoreModule.Core/Currency/DefaultMoneyRoundingPolicy.cs +++ b/src/VirtoCommerce.CoreModule.Core/Currency/DefaultMoneyRoundingPolicy.cs @@ -12,7 +12,7 @@ public decimal RoundMoney(decimal amount, Currency currency) { var roundingType = EnumUtility.SafeParse(currency.RoundingType, RoundingType.Rounding001); var midpointRounding = EnumUtility.SafeParse(currency.MidpointRounding, MidpointRounding.AwayFromZero); - return Round(amount, currency.NumberFormat.NumberDecimalDigits, roundingType, midpointRounding); + return Round(amount, currency.NumberFormat.CurrencyDecimalDigits, roundingType, midpointRounding); } /// diff --git a/tests/VirtoCommerce.CoreModule.Tests/DefaultMoneyRoundingPolicyTests.cs b/tests/VirtoCommerce.CoreModule.Tests/DefaultMoneyRoundingPolicyTests.cs index 4174ac71..55415b39 100644 --- a/tests/VirtoCommerce.CoreModule.Tests/DefaultMoneyRoundingPolicyTests.cs +++ b/tests/VirtoCommerce.CoreModule.Tests/DefaultMoneyRoundingPolicyTests.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using VirtoCommerce.CoreModule.Core.Common; using VirtoCommerce.CoreModule.Core.Currency; using VirtoCommerce.CoreModule.Core.Enums; using Xunit; @@ -14,7 +15,7 @@ public void CanRound(decimal amount, decimal expected, RoundingType roundingType { // Arrange var roundPolicy = new DefaultMoneyRoundingPolicy(); - var currency = new Currency(); + var currency = new Currency(new Language("en-US"), code: null); currency.RoundingType = roundingType.ToString(); currency.MidpointRounding = midpointRounding.ToString();