Best approach to save "price" field
What is the best approach to save decimal values like price, subtotal, and total in a Laravel migration? In my app, I’m using
but since I’m using PostgreSQL, it’s not working. I’m also trying to format the values like this:
How can I fix this?
6 Replies
Common approavh is to use int
Store everything in pence\cents and format for display using money()
So, is that okay? I saved like that
Or like that?
What is your column type ?
Both are decimal
used format
do not use format