Fix brianwash gain percentage

master
jmjl 2024-02-13 10:25:24 +00:00
parent ef60b999dc
commit 2ef3a95ef0
1 changed files with 1 additions and 1 deletions

View File

@ -28,7 +28,7 @@ def cleanwash_money(msg):
balance = Decimal(subprocess.check_output(['/home/jmjl/bin/coin','Ju','internal_balance',nick],universal_newlines=True)) balance = Decimal(subprocess.check_output(['/home/jmjl/bin/coin','Ju','internal_balance',nick],universal_newlines=True))
if balance == Decimal(0): return pinhook.plugin.message("You don't have any tildecoins with us, so you can't cleanwash") if balance == Decimal(0): return pinhook.plugin.message("You don't have any tildecoins with us, so you can't cleanwash")
subprocess.check_output(['/home/jmjl/bin/coin','Ju','add_internal_balance',nick,f'-{str(balance)}'],universal_newlines=True).strip() subprocess.check_output(['/home/jmjl/bin/coin','Ju','add_internal_balance',nick,f'-{str(balance)}'],universal_newlines=True).strip()
new_balance = Decimal(randint(80,110))/Decimal(100)*Decimal(balance) new_balance = Decimal(randint(59,110))/Decimal(100)*Decimal(balance)
new_balance = new_balance.quantize(Decimal('1.'), rounding=ROUND_DOWN) new_balance = new_balance.quantize(Decimal('1.'), rounding=ROUND_DOWN)
percentage_return = new_balance/balance * Decimal(100) percentage_return = new_balance/balance * Decimal(100)
percentage_return = percentage_return.quantize(Decimal('.00'), rounding=ROUND_DOWN) percentage_return = percentage_return.quantize(Decimal('.00'), rounding=ROUND_DOWN)