I have a problem with keeping latitude and longitude in a SQLite database. I can save some location (123.123999, 123.123999) and it will be saved in the database. But if I want to read it, I get a rounded location (123.124, 123.124).
My table created by this sql segment:
CREATE TABLE locs(id INTEGER PRIMARY KEY AUTOINCREMENT, lat DOUBLE, lng DOUBLE, num INTEGER)
And the query results:
SELECT * FROM locs WHERE lat = 123.124; //RETURN NO ROWS SELECT * FROM locs WHERE lat = 123.123999; //RETURN 1 ROW
Therefore, I cannot use the numbers that I get to make queries on the data.
I believe that I am not the first to deal with this problem, because this is the main thing. But I did not find the answers that work with the SQLite database.
How can I read and write the correct number in db?
source share