Android - Save location in SQLite database

n0mak

New Member
I have problem with save latitude and longitude in SQLite database. I can save some location like (123.123999, 123.123999) and it will save in the database.But if I want to read it, I get rounded location like (123.124, 123.124).My table created by this sql segment: \[code\]CREATE TABLE locs(id INTEGER PRIMARY KEY AUTOINCREMENT, lat DOUBLE, lng DOUBLE, num INTEGER)\[/code\]And querys results:\[code\]SELECT * FROM locs WHERE lat = 123.124; //RETURN NO ROWSSELECT * FROM locs WHERE lat = 123.123999; //RETURN 1 ROW\[/code\]So I can't use the numbers I get to do queries on the data. I believe that I am not the first that handling with this problem, because it is basic thing. But I didn't found any answers that work on SQLite database. How can I read and write the correct number in the db?
 
Back
Top