RubyMoney/money — pull request #297 by asellitt (2013-08-02 04:19:11+00:00)
Title: Money division should obey the specified rounding mode

We ran into a problem when using this gem to calculate tax rates, where the value returned was unexpected, and did not match the rounding mode we had explicitly set.

We discovered that this was due to a case of integer division (the fractional is rounded, as per the specified mode, then cast to a Fixnum) and the value we divided by (also an integer) caused the result to be floored (as per integer division).

For example: Given $10, 10% of this is $0.91 (10.00/11 = 0.9091)
Money's / method calculated this as 90 ($0.90).

This change ensures that the division method actually respects the rounding method.

There is an issue discussing this problem (see https://github.com/RubyMoney/money/issues/270), however the answer implies that the consumer of this gem should have an understanding of the underlying implementation.