From 6b6299ac068d96a1cf0aad9595caa6490d706af1 Mon Sep 17 00:00:00 2001 From: Wong Yiek Heng Date: Mon, 6 Oct 2025 07:41:11 +0800 Subject: [PATCH] + Fix credit rounding --- cm_bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cm_bot.py b/cm_bot.py index 2164c99..1c37193 100644 --- a/cm_bot.py +++ b/cm_bot.py @@ -441,7 +441,7 @@ class CM_BOT: ) soup = BeautifulSoup(response.content, 'html.parser') try: - return float(soup.find('table', {'class': 'generalContent'}).find(text=re.compile('Credit Available')).parent.parent.find_all('td')[2].text.replace(",","")) + return round(float(soup.find('table', {'class': 'generalContent'}).find(text=re.compile('Credit Available')).parent.parent.find_all('td')[2].text.replace(",","")), 2) except: print(f"Error getting credit.") now = datetime.datetime.now().strftime('%Y%m%d_%H%M')