I am using Entity Framework 5 code first to talk to an Oracle 11g or 12c database (I've verified the problem in both versions). The Oracle field is a FLOAT
type while the field in my POCO is a decimal
. I'm using decimal
because I need my decimal places to be accurate up to 5 digits.
When I save my entity, the resulting record in the database always rounds the value to 2 decimal places.
I have verified through a database tool (Toad) that the column will support precision of 5. I cannot change the data type in the database due to backwards compatibility. I have found that using a double
does not have the same problem. But double
is notorious for giving inexact numbers, especially when multiple mathematical operations are performed.
Does anyone know why a decimal
value would be truncated? I am using the Oracle data provider.