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

MoneyMismatchException:contextMismatch when using different context #4

Closed
BertKooij opened this issue Mar 3, 2021 · 1 comment
Closed

Comments

@BertKooij
Copy link
Contributor

When using this library with a Money instance with a custom context calculating the inclusive/exclusive price will throw an exception.

The monies do not share the same context. If this is intended, use plus($money->toRational()) instead of plus($money).

In my use case the context should not round the numbers which could be achieved with a custom context. The default context auto rounds the values to the default rounding of the used currency.

@toonvandenbos
Copy link
Member

Thanks for your PR. Released under version 2.0.1.

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