RubyMoney/money

Rounding of CHF / Swiss francs

Closed this issue · 2 comments

The Swiss Franc (CHF) is a rare currency that has gotten rid of 1-4 cents, making the smallest denomination CHF 0.05, or 5 cents. Therefore, CHF 1.23 does not exist, it becomes either 1.20 or 1.25.

There are a few shops that do use 1-cent steps. However, at the bottom of the receipt, they must still end up with a 5-cent precision amount. So you'd see things like:

  • Bread: CHF 1.23
  • Milk: CHF 0.43
  • Rounding difference in your favor: CHF 0.01
  • Grand total: CHF 1.65

It's a pain, especially since the rounding rules are different for a virtual subtotal and an actual payable amount.

Does this gem support anything like it / would you be willing to support it? This would likely also mean to have different behavior for CHF regarding .to_s, .to _f etc.

Unfortunately, I don't really have the time to be active on this project, but a long time ago, we once introduced this feature: #433

Maybe this still works?

Indeed, round_to_nearest_cash_value covers this fully :-)

Thank you very much!