which datatype is better to store dollar values in database - Decimal or currency ?
Hello, @Priya Naveen
Use Decimal data type it's better to store dollar values in the database.
Best Regards,
-- Priya Jhode
Hi Priya,
You can choose Decimal datatype, Please refer this documentation FYR.
Click here
Thanks
Hi there Priya,
You can choose whatever it suits best for your business requirements, since they are essentially the same, as described here:"They are essentially the same. However, having a currency entity attribute will help you a bit while doing scaffolding patterns, as these fields will be automatically formatted as currency. And it kind of helps to document your data model, as you're adding a bit more information about the role of a specific attribute. "KR,
João
The same thought has came in my mind when I was saving the money value in my db .. I have created the decimal data type there I have faced the problem to do the formatting on that .. latter on I have changed into currency itself ..
So suggestion is that you go for Currency data type
Kind regards
Hello
it is better to store dollar values using the **Decimal** datatype. This ensures precision and accuracy for financial calculations and avoids issues with rounding errors that can occur with floating-point types. The **Currency** datatype is not available making **Decimal** the appropriate choice.
I hope it helps!
As @João Sousa mentioned, both are essentially the same.
Use Currency for the sake of these benefits:
1. scaffolding
2. make your data model more clearer to read