-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
What is pros/cons in comparison with moneyphp/money #28
Comments
+1 |
1 similar comment
+1 |
We started with moneyphp and we switched to brick/money, as, in my opinion, the design of brick/money is more flexible. We use money without currency (Users can define a Project-wide currency, and then use this currency throughout the Project). So, actually currency is only handled when we show data to the User. But for a lot of calculations, storing in DB, etc, we still need to work with arbitrary numbers, and brick/money basing on brick/math makes this so easy. |
Here is a non-exhaustive list of differences I compiled. I might be wrong about some of the points, if so please feel free to correct me, and I'll update this post.
OTOH, moneyphp supports the following features that brick/money doesn't: |
Great summary @BenMorel. I'm considering moving my compound prices library to |
Compare to my project https://github.com/phpexpertsinc/MoneyType. It looks extremely similar. https://github.com/brick/math/blob/master/src/Internal/Calculator/BcMathCalculator.php It's almost 1:1, including your using "Internal" direcotry and strategy pattern. The MAJOR difference is that my project's only responsibilities are math manipulation and retrieval of currencies to X decimal places, while you'rs does a lot more of currency conversion, multiple currencies, etc. |
@BenMorel I think you should add your comment to the readme since this will be a very common question and I personally didn't even think to look in the issues for the answer and only found this after being directed here. |
@hopeseekr Thanks for the link, it's always interesting to see how others solve the same problem! I think the major difference between MoneyType and brick/money is that brick/money will by default have a scale that's per-currency (2 for EUR, USD etc.) and complain if you attempt to perform calculations that result in more decimal digits than configured (but provides Contexts to customize this, and RationalMoney to never round); this was a big requirement when creating this library, to ensure that you always handle rounding where necessary, or get an exception. @iaicam The primary aim of this library is not to be a competitor to moneyphp, so I won't make a paragraph there highlighting the differences. However, you're right that this is becoming a frequently asked question, so I will probably add a link to this issue, and try to keep it up to date! 👍 |
A link to this issue has been added to the README. |
What is pros/cons in comparison with https://github.com/moneyphp/money ?
The text was updated successfully, but these errors were encountered: