SQLite stores float values ​​to integer

I am using System.Data.SQLite to save data to a database. The table has 2 columns defined as float. However, when I save data to DB, it only saves the whole part.

12.2345 => 12 11.5324 => 11 (I don't know exactly how it rounds, it just rounds)

Yes, I'm pretty sure I'm using floats in my application, and I'm pretty sure the CommandText contains floating point numbers NOT integers.

+2


source to share


2 answers


You need to use floats in your application, but you also need to make sure that the entry in the SQLite database table is explicitly declared as REAL.



+3


source


There is no support for float as a built-in type. Use TEXT instead.



0


source







All Articles