Question

I'm using System.Data.SQLite to save data to database. In table there are 2 columns defined as float. However when I save data to DB it saves only integer part.

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

Yes I'm sure I'm using floats in my application, and I'm sure that CommandText contains float numbers NOT integer.

Was it helpful?

Solution

You need to be using floats in your application, but you also need to make sure the table entry in the SQLite database has been explicitly declared to be that REAL type.

OTHER TIPS

There is no support for floats as build-in type. Use TEXT instead.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top