moneyphp / money

PHP implementation of Fowler's Money pattern.
http://moneyphp.org
MIT License
4.56k stars 439 forks source link

Possibility to allocate with custom rounding parameter #753

Open Crovitche-1623 opened 10 months ago

Crovitche-1623 commented 10 months ago

In Switerland, the smallest coin is CHF 0.05. It would be a good new feature to be able to allocate the amount with a custom rounding parameter. For instance by adding a parameter to the allocate function: $amount->allocate(3, 0.05)

so the result would be :

8 / 3 = 2.65 + 2.65 + 2.70