You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 14, 2019. It is now read-only.
Describe the bug
In some cases the % ends up exceeding the actual balance, this probably due to python rounding when casting to ints
To Reproduce
have a balance of 7,847,709,332,162,940 M¢
!invest 100%
bot doesnt take it
Expected behavior
Invest all your money
TO FIX:
change # Allows input such as '!invest 100%' and '!invest 50%' if suffix == '%': amount = int((investor.balance / 100) * int(amount))
to: # Allows input such as '!invest 100%' and '!invest 50%' if suffix == '%': amount = int((investor.balance) * int(amount/100))
should also fix the error with one coin left after invest 100%
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
In some cases the % ends up exceeding the actual balance, this probably due to python rounding when casting to ints
To Reproduce
Expected behavior
Invest all your money
TO FIX:
change
# Allows input such as '!invest 100%' and '!invest 50%' if suffix == '%': amount = int((investor.balance / 100) * int(amount))
to:
# Allows input such as '!invest 100%' and '!invest 50%' if suffix == '%': amount = int((investor.balance) * int(amount/100))
should also fix the error with one coin left after invest 100%
The text was updated successfully, but these errors were encountered: