fix(swap): 解决(观察日)利率计算精度问题并优化价格精度处理
- 在SwapDealService中对GetFixedRate结果进行精度调整,解决原数据精度误差问题 - 在swapPricePrecisionHelper中添加roundDecimal方法并移除TODO注释 - 新增observationRate相关的精度处理函数,包括roundObservationRate和percent转换函数 - 创建serializeSwapIntervals函数用于处理掉期区间利率精度序列化 - 将consNumberFormat.umpriceP替换为swapPricePrecision.shiftDecimal进行百分比转换 - 使用新的精度处理函数替代原有的toFixed(6)和乘以0.01的操作
This commit is contained in:
@@ -712,7 +712,7 @@ namespace YLErp.Modules.SwapModule
|
||||
}
|
||||
|
||||
// 获取利率
|
||||
decimal rate = GetFixedRate(position, unwindDate);
|
||||
decimal rate = Math.Round(GetFixedRate(position, unwindDate), InterestCalculationPrecision, MidpointRounding.AwayFromZero); // 做精度调整 原数据有精度误差
|
||||
decimal floatRate = GetFloatRate(position, preEodPosition, td.StartDate.Value, endDate, interestPeriod, swap, positionClone);
|
||||
|
||||
// 根据场景计算利息
|
||||
|
||||
Reference in New Issue
Block a user