Skip to content

Commit

Permalink
ZeroDivisionError: division by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
seii-saintway committed Oct 6, 2020
1 parent dceb5ca commit 0236ac1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,9 @@
" if len(bought_unit_amounts) > 0:\n",
" bought_unit_amount_before = bought_unit_amount\n",
"\n",
" bought_unit_amount = bought_unit_amounts[0]\n",
" used_jpy *= bought_unit_amount / bought_unit_amount_before\n",
" if bought_unit_amount_before > 0:\n",
" bought_unit_amount = bought_unit_amounts[0]\n",
" used_jpy *= bought_unit_amount / bought_unit_amount_before\n",
"\n",
" now_ticker = pub.get_ticker('eth_jpy')\n",
" now_sell_jpy = int(now_ticker.get('buy', '0'))\n",
Expand Down

0 comments on commit 0236ac1

Please sign in to comment.