Issue #12958 has been updated by Jerome Cornet.


Unfortunately there are many instances where money math requires floating point calculation, like taxes for example (discounts are also another source of float-related money math)

Most jurisdictions that charge sales taxes specify rounding up by law: here are 2 US law texts, http://www.tax.ohio.gov/sales_and_use/information_releases/st200505.aspx, http://www.tax.ohio.gov/sales_and_use/information_releases/st200505.aspx, I live in Canada and it's the same http://www.gst-tax.com/GST/Accounting_for_GST.htm. In the UK, it can be both up or down, but in retail it's rounded up as well https://www.gov.uk/government/publications/vat-notice-700-the-vat-guide/vat-notice-700-the-vat-guide#calculation-of-vat-at-retailers

Banker's rounding is actually a poorly named rounding method, as it is only used outside the financial industry. It has the nice property for statistical analysis that it has no bias over the entire numbers space; it's better named as Gaussian rounding.

There are many companies in the financial industry that use ruby, making a change like this is actually a bigger deal than just breaking rails views.

----------------------------------------
Bug #12958: Breaking change in how `#round` works
https://bugs.ruby-lang.org/issues/12958#change-61800

* Author: Rafael Fran├ža
* Status: Assigned
* Priority: Normal
* Assignee: Kenta Murata
* ruby -v: 
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
We noticed in the Rails test suite that there is a breaking change in how `#round` works between 2.3 and 2.4

https://github.com/rails/rails/pull/27091

Is that desirable?

I think it is may cause a lot of problem if the behavior of `#round` without any arguments changes between a minor version.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>