Hibernate version: NHibernate1.2.0Beta2
I have a column in a database of type "real". The data in the database can have a high precision (1.40000001 for example). However, whenever I try to Get a row in that table the value is rounded and I lose precision. 1.40000001 becomes 1.4 which throws off our shipping calculations for some countries. I have tried a multitude of things:
Straight nHibernate Gets
ExecuteScalar with a stored proc
ExecuteNonQuery into a dataset from the stored proc
A raw SELECT statement
The type in the database is "real" the nhibernate auto-generated mapping file has the type set at "single". The .NET class is of course also "single". I have tried changing it to other types such as float, and decimal but the problem still occurs.
I have searched on the forums for ways to get around this rounding issue but didn't find anything.
There are also other properties in the same mapping file of type "decimal" that are getting their full precision on a Get. These columns are alos of a different type than "real" in the database.
example:
Code:
<property column="Weight" type="System.Decimal" name="Weight" />
<property column="RetailPrice" type="System.Decimal" name="RetailPrice" />
Weight comes back with rounded precision whereas RetailPrice comes back with its full precision.
Please help, thanks:)