sqlite select query round of double value

Posted by Scorpion on Stack Overflow See other posts from Stack Overflow or by Scorpion
Published on 2012-12-13T16:39:07Z Indexed on 2012/12/13 17:03 UTC
Read the original article Hit count: 367

Filed under:
|
|
|

I have stored location in my sqlite database.

CREATE TABLE city
    (
        latitude NUMERIC,
        longitude NUMERIC
    )

Below are the value :-

latitude = 41.0776605;//actual value in db - NUMERIC stored as DB
longitude = -74.170086;//actual value in db - NUMERIC stored as DB


final String query = "SELECT * FROM city";    
cursor = myDataBase.rawQuery(query, null);
        if (null != cursor) {
            while (cursor.moveToNext()) {
                Log.i(TAG, "Latitude == " + cursor.getDouble(cursor.getColumnIndex("latitude")));
                Log.i(TAG, "Longitude == " + cursor.getDouble(cursor.getColumnIndex("longitude")));
            }
        }

Result :-

Latitude = 40.4127
Longitude = -74.25252

I don't want round off this values. Is there any way to solve this problem.

© Stack Overflow or respective owner

Related posts about android

Related posts about sqlite