Browse Source

Merge branch 'bzq1/fix_excel_history_data' of eta_server/eta_api into debug

baoziqiang 4 months ago
parent
commit
a1b6dd3c5b
1 changed files with 1 additions and 2 deletions
  1. 1 2
      utils/common.go

+ 1 - 2
utils/common.go

@@ -2784,8 +2784,7 @@ func RoundNumber(num string, decimalPlaces int, hasPercent bool) string {
 	if hasPercent {
 		numDecimal = numDecimal.Mul(decimal.NewFromInt(100))
 	}
-	numFloat, _ := numDecimal.Round(int32(decimalPlaces)).Float64()
-	numStr := strconv.FormatFloat(numFloat, 'f', decimalPlaces, 64)
+	numStr := numDecimal.Round(int32(decimalPlaces)).StringFixed(int32(decimalPlaces))
 	if hasPercent {
 		numStr += "%"
 	}