Mokhtar Ghaleb
Mokhtar Ghaleb

Reputation: 463

which data type to store a longitude and a latitude in a SQLite database?

I created a table with fields map_latitude and map_longitude in Sqlite Data Base with data type REAL.

But when I retrieved data from the database in Toast Message I see it with only zero decimal point.

for example:

15.31894  
store as 15.0  

how can I solve this?

Upvotes: 8

Views: 8101

Answers (1)

IntelliJ Amiya
IntelliJ Amiya

Reputation: 75788

You should use Data-Type REAL.

The value is a floating point value, stored as an 8-byte IEEE floating point number.

Safe Approach is -> Using TEXT

Upvotes: 8

Related Questions