Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
money bug
capital = Money.from_amount("985.13464".to_f, "eu16")
price = Money.from_amount("707.5".to_f, "eu16")
size = Money.from_amount(capital / price, "btc16")
(capital - price * size.to_f).format
=> "€0,0000000000000000"
capital = Money.from_amount("985.13464".to_f, "eu16")
price = Money.from_amount("707.5".to_f, "eu16")
size = Money.from_amount(capital / price, "btc16")
(capital - price * size.to_d).format
=> "€-0,0000000000001500"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.