Hello, I store all prices in subunit as int.
I use this package for price manipulation and store new value to database
Ex:
in db 34237 → in frontend $342.37
right now i do like this
(int)Money::USD($price)->multiply(2)->getAmount()
In my opinion, it's easy to forget about int conversion.
I think, additional method can solve this problem, ex getAmountAsInt() or similar
As reference https://github.com/brick/money#persisting-the-amount
Hello, I store all prices in subunit as int. I use this package for price manipulation and store new value to database Ex: in db 34237 → in frontend $342.37 right now i do like this
(int)Money::USD($price)->multiply(2)->getAmount()
In my opinion, it's easy to forget about int conversion. I think, additional method can solve this problem, ex getAmountAsInt() or similar As reference https://github.com/brick/money#persisting-the-amountThank you