Skip to content

Instantly share code, notes, and snippets.

@lulalala
Created June 16, 2016 03:06
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save lulalala/57506dbfc7dfa3affc28112fec49f113 to your computer and use it in GitHub Desktop.
irb(main):016:0> Money.new(1.5) == 0.015.to_money
=> true
irb(main):017:0> Money.new(1.5).instance_variable_get(:@fractional).to_s
=> "1.5"
irb(main):018:0> 0.015.to_money.instance_variable_get(:@fractional).to_s
=> "2.0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment