|
@@ -1757,14 +1757,15 @@ func GetChartPredictEdbInfoDataListByRuleAnnualValueInversion(edbInfoId int, con
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ if sum == 0 {
|
|
|
+ err = errors.New("同比年份的累计值为0")
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
avg = sum / float64(len(yearList))
|
|
|
|
|
|
|
|
|
- tbVal := decimal.NewFromFloat(0)
|
|
|
- if avg != 0 {
|
|
|
- tbVal = decimal.NewFromFloat(currYearBalance).Div(decimal.NewFromFloat(avg))
|
|
|
- }
|
|
|
+ tbVal := decimal.NewFromFloat(currYearBalance).Div(decimal.NewFromFloat(avg))
|
|
|
|
|
|
fmt.Printf("同比增速%.4f\n", tbVal11)*/
|
|
|
|