Quellcode durchsuchen

Merge remote-tracking branch 'origin/contract_quotation' into debug

Roc vor 3 Jahren
Ursprung
Commit
75d179307a
1 geänderte Dateien mit 2 neuen und 1 gelöschten Zeilen
  1. 2 1
      utils/common.go

+ 2 - 1
utils/common.go

@@ -8,6 +8,7 @@ import (
 	"encoding/json"
 	"errors"
 	"fmt"
+	"github.com/shopspring/decimal"
 	"image"
 	"image/png"
 	"math"
@@ -686,7 +687,7 @@ func getMonthDay(year, month int) (days int) {
 
 // FormatPrice 格式化展示金额数字(财务金额展示,小数点前,每三位用,隔开)    1,234,567,898.55
 func FormatPrice(price float64) (str string) {
-	str = fmt.Sprint(price)
+	str = decimal.NewFromFloat(price).String()
 	length := len(str)
 	if length < 4 {
 		return str