• Welcome, Guest. Please login.
 
May 07, 2021, 11:38:26 PM

News:

Welcome to the SQLitening support forums!


Sqlite truncate/rounding off the field value

Started by keyuraashra, December 30, 2012, 05:30:40 AM

Previous topic - Next topic

keyuraashra

Hello All,

I am Android Developer and working in mobile app development since long but recently faced a strange issue related to sqlite 3 in one of my project development. I am dealing with location based services since long and related to that many times i used great circle calculation query to find the location.

In that I mostly worked with MySQL but this time we are utilizing the SQLite for this. In that I am trying to get the distance from my calculation which returns me something like 0.9999866110992728. This kind of values are returned from the DB and I am successfully able to get it on SQLite Browser. But when I am trying it to connect with android and trying to run the query it creates problem and truncating/rounding off the values like distance_root ==> 0.113404.

Query which i am using is too long so i can not write it here but the way which I am using to get it from android is like below.

cursor = myDataBase.rawQuery(query, null);
if (null != cursor) {
while (cursor.moveToNext()) {
Log.i(TAG, "distance_root ==> " + cursor.getString(cursor.getColumnIndex("distance_root")));

pojo.setDistance(cursor.getString(cursor.getColumnIndex("distance_root")));

}
}


If anyone has any idea about this please kindly give me any solution.

Thanks