浏览代码

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

Roc 3 年之前
父节点
当前提交
75d179307a
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      utils/common.go

+ 2 - 1
utils/common.go

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