|
@@ -343,10 +343,10 @@ func GetChartData(chartInfoId int, config request.ChartConfigReq) (edbList []*da
|
|
|
}
|
|
|
if !date.Before(earliestDate) && !date.After(endDate) {
|
|
|
bigN += 1
|
|
|
- }
|
|
|
- dateVal := decimal.NewFromFloat(dataList[i].Value)
|
|
|
- if dateVal.LessThanOrEqual(lastVal) {
|
|
|
- tinyN += 1
|
|
|
+ dateVal := decimal.NewFromFloat(dataList[i].Value)
|
|
|
+ if dateVal.LessThanOrEqual(lastVal) {
|
|
|
+ tinyN += 1
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
// N=1时说明计算无效
|
|
@@ -355,7 +355,7 @@ func GetChartData(chartInfoId int, config request.ChartConfigReq) (edbList []*da
|
|
|
}
|
|
|
numerator := decimal.NewFromInt(int64(tinyN - 1))
|
|
|
denominator := decimal.NewFromInt(int64(bigN - 1))
|
|
|
- percentVal, _ = numerator.Div(denominator).Round(4).Float64()
|
|
|
+ percentVal, _ = numerator.Div(denominator).Mul(decimal.NewFromFloat(100)).Round(4).Float64()
|
|
|
}
|
|
|
|
|
|
// key的生成(日期配置下标+指标id)
|