Great advice! I have seen a lot saying to always store prices as cents, but I've run into more issues with this approach than yours, particularly when it comes to supporting multiple currencies like JPY which don't have decimals units.
Thanks ! Small precision that we need to know when we use this advice: during the model creation and depending of the need, we can adapt the first digit :
price:decimal{3,2} # value between. -9.99 and 9.99
price:decimal{4,2} # value between. -99.99 and 99.99
price:decimal{5,2} # value between. -999.99 and 999.99
etc.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Great advice! I have seen a lot saying to always store prices as cents, but I've run into more issues with this approach than yours, particularly when it comes to supporting multiple currencies like JPY which don't have decimals units.
Thanks ! Small precision that we need to know when we use this advice: during the model creation and depending of the need, we can adapt the first digit :