|
@@ -1244,7 +1244,14 @@ func GetTableDataByMixedTableData(config [][]request.MixedTableCellDataReq, hide
|
|
|
rounded := math.Round(tmpShowValue*factor) / factor
|
|
|
if styleConfig.Nt == "percent" {
|
|
|
percent := rounded * 100
|
|
|
- tmp.Monitor = fmt.Sprintf("%g%%", percent)
|
|
|
+ var precisionStr string
|
|
|
+ if *styleConfig.Decimal > 2 {
|
|
|
+ precision := *styleConfig.Decimal - 2
|
|
|
+ precisionStr = strconv.FormatFloat(rounded, 'f', precision, 64)
|
|
|
+ } else {
|
|
|
+ precisionStr = strconv.FormatFloat(math.Round(percent), 'f', -1, 64)
|
|
|
+ }
|
|
|
+ tmp.Monitor = fmt.Sprintf("%s%%", precisionStr)
|
|
|
} else {
|
|
|
tmp.Monitor = fmt.Sprintf("%g", rounded)
|
|
|
}
|