Closed otilor closed 2 years ago
When I try to run this script, it works except that the amount doesn't get converted to the float amount
use Bavix\Wallet\Models\Transaction;
Transaction::query()->where('type', 'deposit')->where('payable_id', 1)->get();
I get 400000
instead of 4000.00
Hello.
I want to show the funding history of a customer. I want to be able to retrieve all the deposits to their wallet. Is there a way to achieve this with the package?
See https://github.com/bavix/laravel-wallet/issues/314 https://github.com/bavix/laravel-wallet/issues/240 https://github.com/bavix/laravel-wallet/issues/203 https://github.com/bavix/laravel-wallet/issues/198 https://github.com/bavix/laravel-wallet/issues/277
When I try to run this script, it works except that the amount doesn't get converted to the float amount
The package only works with integer values. The reason is in the mantissa (Numerical Methods). https://github.com/bavix/laravel-wallet/issues/149#issuecomment-600041147
When I try to run this script, it works except that the amount doesn't get converted to the float amount
use Bavix\Wallet\Models\Transaction; Transaction::query()->where('type', 'deposit')->where('payable_id', 1)->get();
I get
400000
instead of4000.00
What I did to fix this was to use the amountFloat
attribute.
This attribute exists in transactions. You can use it. https://github.com/bavix/laravel-wallet/blob/7a30789a2f102f5dd1e4a094a177e726cdb64f0b/tests/Units/Domain/WalletFloatTest.php#L201-L204
I want to show the funding history of a customer. I want to be able to retrieve all the deposits to their wallet. Is there a way to achieve this with the package?