I have came across several articles that mentioned that advise on not to store monetary value as decimal, but use integer instead. The reasoning that it does not store actual value and will cause some rounding difference/errors. But i have yet ever participate in any project that use an integer datatype for monetary value in database storage.
My question is:
1) Is there any solid business use case/scenario/example of using decimal datatype (19, 4) on monetary value that will result in rounding issue? As so far i had yet to experience the above mentioned issue.
2) As we all know that fiat currency have range of decimal place of 0 to 3 depending on countries.
Imagine now that we have a system that accepts fiat currencies transfer based on configuration configured in currencies config table.
Is it common to implement a decimal constraint for each currency during insert or we leave it to application level to deal with that?
TransactionLog -------------- CurrencyID UserIDFrom UserIDTo TransactionDateTime CurrencyAmount (decimal(19, 4)