I'm putting a float in an Android based SQLite database, like so:
private static final String DATABASE_CREATE =
"create table " + DATABASE_TABLE + " ("
+ KEY_ID + " integer primary key autoincrement, "
+ KEY_FLOAT + " REAL, " + ...
...
content.put(KEY_FLOAT, 37.3f);
db.insert(DATABASE_TABLE, null, content);
When I query the table:
Cursor cursor = db.query(false, DATABASE_TABLE,
new String[] { KEY_ID, KEY_FLOAT, ... },
KEY_LATITUDE + "=37.3",
null, null, null, null, null);
the cursor comes back empty. If I change the value of the float to 37.0 it works properly, returning the record in the cursor.
I've tested this at some length, changing the database column spec from "REAL" to "float", etc. AS long as I have any fractional portion after the decimal point, the cursor returns empty. What is going on?
Thanks in advance!