bavix / laravel-wallet

It's easy to work with a virtual wallet
https://bavix.github.io/laravel-wallet/
MIT License
1.14k stars 230 forks source link

Suggestion: use specialized package to handle financials transactions #139

Closed damms005 closed 4 years ago

damms005 commented 4 years ago

Mathematical manipulation of money (adding, subtracting etc.) can be very tricky (floating point precision, etc.).

For the reason above, there is a package designed specifically for this purpose. I suggest you consider using it: https://github.com/akaunting/money

Thanks

rez1dent3 commented 4 years ago

@damms005 Hey. I saw this library. This is a very good package for working with currency. I am of the opinion that wallet is something universal. I do not get attached to the currency - this is done by the developer. The library does not say "I only work with the dollar, the ruble and the larry", and the developer decides what he needs. Thanks you.

damms005 commented 4 years ago

@rez1dent3 You are very correct about that. I was curious that such a package may be advantageous over direct money manipulations like this.

...or maybe not \_(0)_/

rez1dent3 commented 4 years ago

@damms005 Thank you! I will add gmp (GNU Multiple Precision) support for adding large numbers, a bit later.

rez1dent3 commented 4 years ago

@damms005 Choosing between gmp and bcmath - chose bcmath. The next major version of the library will support arbitrary precision calculations.

You can follow the development here and here.

rez1dent3 commented 4 years ago

@damms005 see tag 5.0.0