From 9af9116970d141d81ba07aae558f48ebdac3a977 Mon Sep 17 00:00:00 2001 From: Artem Dudarev Date: Fri, 15 Nov 2024 15:23:32 +0200 Subject: [PATCH] fix: Change return type to decimal when dividing Money by Money --- src/VirtoCommerce.CoreModule.Core/Currency/Money.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/VirtoCommerce.CoreModule.Core/Currency/Money.cs b/src/VirtoCommerce.CoreModule.Core/Currency/Money.cs index 4d779988..c4a7b831 100644 --- a/src/VirtoCommerce.CoreModule.Core/Currency/Money.cs +++ b/src/VirtoCommerce.CoreModule.Core/Currency/Money.cs @@ -119,8 +119,8 @@ public decimal TruncatedAmount public static Money operator *(Money first, Money second) => new Money(first.InternalAmount * second.ConvertTo(first.Currency).InternalAmount, first.Currency); - public static Money operator /(Money first, Money second) - => new Money(first.InternalAmount / second.ConvertTo(first.Currency).InternalAmount, first.Currency); + public static decimal operator /(Money first, Money second) + => first.InternalAmount / second.ConvertTo(first.Currency).InternalAmount; public static bool operator ==(Money money, long value) => !(money is null) && money.InternalAmount == value;