4 ms·
This is something I am aware but there is no support for this rounding scheme at the moment.
by eriksencosta 2y ago
This is something I am aware but there is no support for this rounding scheme at the moment.
- amluto 2y agoWait, how do you round? A fixed table from currency to minimum increment? You’re not about to find 1/100-Yen coins, for example.
- criddell 2y agoThings like gasoline can have a price that is a fraction of a cent. The ultimate price is rounded. Canada has these guidelines: https://www.canada.ca/en/revenue-agency/programs/about-canada-revenue-agency-cra/phasing-penny.html https://www.canada.ca/en/revenue-agency/programs/about-canad...
- vetinari 2y agoYou are not going to find 1 or 2 eurocents anymore either, but it is still a valid amount. You can pay that electronically, but not in cash. So rounding for cash is a different problem that rounding money in general.
- cyxxon 2y agoHuh? 1 and 2 eurocents have not been deprecated, afaik only Finland and the Netherlands don't use them anymore...
- vetinari 2y agoAlso Belgium, Ireland, Italy, Slovakia... Technically, you can use them for payment, they are still valid money; but the price will be rounded to 5 cents when paying in cash and you won't get them in the other direction.
- jeroenhd 2y agoThe 1 and 2 eurocent coins are still legal tender in the Netherlands, stores just have the option not to accept them and are allowed to round prices to avoid having to stock them (if communicated beforehand). It's been years since I last saw a eurocent coin, but it's been eliminated by permitting businesses to remove the need for them, not because they're being phased out.
- sigh_again 2y ago>You are not going to find 1 or 2 eurocents anymore either You may want to tell that to my wallet, as well as the payments I make with them. There's a cool 37 billion coins outside in the wild, so you're going to find them rather easily throughout Europe, even if your own country has stopped using them.
- eriksencosta 2y agoHALF_EVEN by default using the minor units of each currency (based on CLDR/ICU datasets). Client code can disable rounding at all. Check for more: https://github.com/eriksencosta/money/blob/trunk/docs/usage/rounding.md https://github.com/eriksencosta/money/blob/trunk/docs/usage/...