Skip to content
This repository has been archived by the owner on Oct 14, 2019. It is now read-only.

Invest % doesnt work in some cases #444

Open
Caribosaurus opened this issue Jul 12, 2019 · 0 comments
Open

Invest % doesnt work in some cases #444

Caribosaurus opened this issue Jul 12, 2019 · 0 comments

Comments

@Caribosaurus
Copy link
Contributor

Caribosaurus commented Jul 12, 2019

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

  1. have a balance of 7,847,709,332,162,940 M¢
  2. !invest 100%
  3. 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%

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant