using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace YLErp.Helpers
{
public static class TradeFeeHelper
{
///
/// 计算含费价格
///
///
///
///
///
///
public static decimal CalcPriceWithFee(decimal fee, decimal price, decimal qty,int deriction)
{
if (qty == 0)
{
return 0;
}
decimal derictionFlag = deriction == 1 ? 1 : -1;
decimal priceFee = (price * qty + fee* derictionFlag) / qty;
return priceFee;
}
}
}