public
Created

How to deal with Decimals.

  • Download Gist
gistfile1.rb
Ruby
1 2 3 4 5
1.9.3-p0 :005 > (BigDecimal("70") - BigDecimal("10.95")).to_s("F")
=> "59.05"
1.9.3-p0 :006 > (BigDecimal("70") - BigDecimal("40.95")).to_s("F")
=> "29.05"
1.9.3-p0 :007 >

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.