+ Fix credit rounding

This commit is contained in:
Wong Yiek Heng 2025-10-06 07:41:11 +08:00
parent 1ae8d041f1
commit 6b6299ac06

View File

@ -441,7 +441,7 @@ class CM_BOT:
) )
soup = BeautifulSoup(response.content, 'html.parser') soup = BeautifulSoup(response.content, 'html.parser')
try: 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: except:
print(f"Error getting credit.") print(f"Error getting credit.")
now = datetime.datetime.now().strftime('%Y%m%d_%H%M') now = datetime.datetime.now().strftime('%Y%m%d_%H%M')