1
Fork 0
mirror of https://github.com/Steffo99/greed.git synced 2025-03-13 12:17:27 +00:00

fix rounding issues

This commit is contained in:
Darren 2020-01-29 14:51:35 +02:00
parent 1bcb243337
commit a9c520541b
2 changed files with 2 additions and 2 deletions

View file

@ -159,7 +159,7 @@ def callback():
# Convert satoshi to fiat
satoshi = float(flask.request.args.get("value"))
received_btc = satoshi/1.0e8
received_value = round(received_btc*transaction.price, 2)
received_value = round(received_btc*transaction.price, configloader.config["Payments"]["currency_exp"])
print ("Recieved "+str(received_value)+" "+configloader.config["Payments"]["currency"]+" on address "+address)
# Add the credit to the user account
user = dbsession.query(db.User).filter(db.User.user_id == transaction.user_id).one_or_none()

View file

@ -281,7 +281,7 @@ class ChatWorker(threading.Thread):
if status >= 0:
# Convert satoshi to fiat
received_btc = value/1.0e8
received_value = round(received_btc*transaction.price, 2)
received_value = round(received_btc*transaction.price, configloader.config["Payments"]["currency_exp"])
# Add the credit to the user account
user = self.session.query(db.User).filter(db.User.user_id == transaction.user_id).one_or_none()