I have to represent numbers in my database, which are amounts of chemical substances in food, like fats, energy, magnesium and others. These values are decimals in format 12345.67.
If I use decimal (5,2)
as data type in SQL Server, it maps to Decimal
type in Entity Framework. If I use float as data type in SQL Server, it maps to Double
in Entity Framework.
I'm not sure what the best data type in SQL Server would have to be, or doesn't it really matter a lot?
EDIT - in my case it should be decimal(7,2)
, as mentioned in some of the remarks!
Thanks.
You need decimal(7,2)
Differences:
References:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With