@@ -110,10 +110,10 @@ func ResidualAnalysisPreview(req residual_analysis_model.ResidualAnalysisReq) (r
}
if req.ResidualType == 2 {
- resp.A = a
- resp.B = b
- resp.R = r
- resp.R2 = R2
+ resp.A = math.Round(a*10000) / 10000
+ resp.B = math.Round(b*10000) / 10000
+ resp.R = math.Round(r*10000) / 10000
+ resp.R2 = math.Round(R2*10000) / 10000
return resp, nil
@@ -70,7 +70,7 @@ func AddDate(t time.Time, years, months int) time.Time {
targetMonth = (targetMonth-1)%12 + 1
// 计算目标年份
- targetYear := t.Year() + years + (int(month)+months)/12
+ targetYear := t.Year() + years + (int(month)+months-1)/12
// 计算目标月份最大天数
maxDayOfTargetMonth := daysOfMonth[targetMonth-1]