Advertisement
Guest User

Untitled

a guest
Apr 30th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. dollar_amount_string = "5.32"
  2. dollar_amount_bigdecimal = BigDecimal.new(dollar_amount_string)
  3. cents_amount_bigdecimal = dollar_amount_bigdecimal * BigDecimal.new(100)
  4. cents_amount_int = cents_amount_bigdecimal.to_i
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement