Skip to content

Instantly share code, notes, and snippets.

@markmansour-zz
Created March 7, 2012 00:33
Show Gist options
  • Save markmansour-zz/1990113 to your computer and use it in GitHub Desktop.
Save markmansour-zz/1990113 to your computer and use it in GitHub Desktop.
How to deal with Decimals.
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 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment