You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The correct result should be #Money<:CHF, 125.75> though, since the smallest coin in CHF is 0.05 (5 centimes called "Rappen"). See in the table here: https://en.wikipedia.org/wiki/Swiss_franc#Coins
In accounting the smallest precision is 0.01 (1 centime).
The text was updated successfully, but these errors were encountered:
As of this commit the rounding is now correctly made. Note too that the option to specify cash digits rounding is currency_digits: :cash, not cash: true. The updated release will be in hex in a few minutes.
Changelog for Money v2.2.1
This is the changelog for Money v2.2.1 released on February 22, 2018. For older changelogs please consult the release tag on GitHub
Bug Fixes
Correctly round to cash increment Money.round/2 now correctly uses the rounding increment for a currency. This is relevant for currencies like :AUD and :CHF which have minimum cash rounding of 0.05 even though the accounting increment is 0.01. Thanks to @maennchen. Closes Money.split/2 cash option behaving wrong #56.
Update documentation for Money.round/2 to correctly refer to the option :currency_digits with the valid options of :cash, :accounting and :iso. The default is :iso. The option cash: true is invalid.
The documentation mentions this example:
The correct result should be
#Money<:CHF, 125.75>
though, since the smallest coin in CHF is0.05
(5 centimes called "Rappen"). See in the table here: https://en.wikipedia.org/wiki/Swiss_franc#CoinsIn accounting the smallest precision is
0.01
(1 centime).The text was updated successfully, but these errors were encountered: