KB-20071120-017

From Triled Wiki

Jump to: navigation, search

Table must have floating point fields (example from Andrey Fedoseev's post):

CREATE TABLE items (_id integer primary key autoincrement, title text not null, amount real not null, date integer not null);

Be sure you have some data here:

sqlite> select * from items;
63|asd|1.0|1195380242797

use Cursor to get data:

Cursor c = db.query(DATABASE_TABLE, new String[] {"_id", "title", "amount", "date"}, "_id=63", null, null, null,null);
c.first();
double amount_value = c.getDouble(c.getColumnIndex("amount"));


Expected value 1.0, but result is 4.60718e+18

Note:
For value 0.0 code is working.
Personal tools