From c55e1fe94d7ced3d9b16a238a972b4c8b8ef3dc3 Mon Sep 17 00:00:00 2001 From: MCTBL <2772337924@qq.com> Date: Tue, 9 Jan 2024 20:24:18 +0800 Subject: [PATCH] Update balance.py --- balance.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/balance.py b/balance.py index f3d8e59..6d9027a 100644 --- a/balance.py +++ b/balance.py @@ -84,7 +84,8 @@ def sendInfo(nowTime, userName, balance): getCharacterIDAndName() url = baseUrl + "/legacy/characters/{}/wallet/?datasource={}&token={}".format( str(userID), datasource, access_token) - balance = float(json.loads(req.get(url).content)) + balance = str('{:,}'.format( + round(float(json.loads(req.get(url).content)), 2))) nowtime = datetime.datetime.now(tz=tz.gettz( "Asia/China")).strftime("%Y-%m-%d %H:%M:%S") - sendInfo(nowtime, userName, str(round(balance, 2))) + sendInfo(nowtime, userName, balance)