When I enter a double number from C # into the database, I use the real type in the database. When I check the value, this is exactly what I enter.
Now when I go to restore the value from the DB and save it in double C #, it adds random decimal values ββat the end. The number in the database is the correct value I want, but the value in C # as a double is just random (sometimes higher sometimes lower than the actual value.)
ie
- Enter into the db 123.43 as a double to an sql real. - View the value in the DB, it exactly 123.43 - Get the value from the DB and store into a C# double, value in the double is now 123.4300000305176
I tried changing the type to float, decimal, etc. in the database, but these types actually change the value when I put it in the database in the same format as above.
Any help on what's happening or how to fix it?
source share