From d11f7f75c267bc798e36137a431a8fcc22693618 Mon Sep 17 00:00:00 2001 From: by <123456@qq.com> Date: Sat, 29 Jun 2024 18:03:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=92=BB=E7=9F=B3=E5=AD=98=E9=92=B1=E7=BD=90?= =?UTF-8?q?=20BUG=E4=BF=AE=E6=94=B9=E5=8F=AA=E4=BF=9D=E7=95=99=E5=B0=8F?= =?UTF-8?q?=E6=95=B0=E7=82=B9=E5=90=8E4=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/welfmgr.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/worldsrv/welfmgr.go b/worldsrv/welfmgr.go index d5891f9..9ea3150 100644 --- a/worldsrv/welfmgr.go +++ b/worldsrv/welfmgr.go @@ -3,7 +3,6 @@ package main import ( "fmt" "math" - "strconv" "time" "mongo.games.com/goserver/core/logger" @@ -1936,8 +1935,7 @@ func (this *WelfareMgr) UpdateDiamondBankData(p *Player, coinNum int64, isWin bo addDiamond = float64(coinNum) * float64(LoseCoinRate) / 10000000 } //保留小数点后4位 - diamondStr := fmt.Sprintf("%.4f", addDiamond) - addDiamond, _ = strconv.ParseFloat(diamondStr, 64) + addDiamond = math.Round(addDiamond*10000) / 10000 p.WelfData.DiamondBank.BankDiamond += addDiamond pool := srvdata.PBDB_PigBank_DiamondMgr.Datas.GetArr() infoData := pool[0]