Skip to content

Commit

Permalink
Update balance.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MCTBL committed Jan 9, 2024
1 parent 9170e7a commit c55e1fe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit c55e1fe

Please sign in to comment.