Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def calc_eth(eth_currency, target_eth, eth_asset, try_asset)
- x = 1
- loop do
- if (((x / eth_currency.to_f) + eth_asset) * target_eth.to_f) <= try_asset + x
- x = x + 1
- else
- break
- end
- end
- x
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement