@@ -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