Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Split #39

Open
slunak opened this issue Dec 16, 2024 · 2 comments
Open

Feature Request: Split #39

slunak opened this issue Dec 16, 2024 · 2 comments

Comments

@slunak
Copy link

slunak commented Dec 16, 2024

This is more of a feature request for a missing splitting into parts functionality, similar to the way it is done here https://github.com/govalues/money

// Split returns a slice of amounts that sum up to the original amount,
// ensuring the parts are as equal as possible.

Any chance this functionality can be added to the library please?

@bojanz
Copy link
Owner

bojanz commented Dec 19, 2024

To be honest, in a decade of writing eCommerce applications, I've never had the use case for a Split method.
Would love to hear yours?

In general, I'm not against having this logic in bojanz/currency. Are you interested in sending in a PR?

@slunak
Copy link
Author

slunak commented Dec 22, 2024

To be honest, in a decade of writing eCommerce applications, I've never had the use case for a Split method. Would love to hear yours?

In general, I'm not against having this logic in bojanz/currency. Are you interested in sending in a PR?

For example, a store order, split into three parts which customer then can pay in three installments over three month.

In regards to a PR, I wont be able to work on it at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants