Money with precision
I’ve been working on a project that needs to store mileage reimbursement rates to the nearest tenth of a cent. We were using the money
gem, which stores money amounts in cents, so it looked like it was going to be a pain.
But without too much suffering, I modified the money gem to take a precision (in powers of 10), which defaults to 2. It can now store amounts in any precision.
You can also store amounts in negative precisions, like millions:
Check out our fork of the money gem on github. There are lots of other goodies in there.