davibe/Phonegap-SQLitePlugin — Issue #9: Float numbers not returning with select statement
Author: padzilla
Created: 2012-03-04 02:52:39+00:00
State: open

I have a float type of column that was only returning the integer portion of the value stored in my DB.
I had to change this in PGSQLitePlugin.m:
case SQLITE_FLOAT:
columnValue = [NSNumber numberWithFloat: sqlite3_column_int(statement, i)];
columnName = [NSString stringWithFormat:@"%s", sqlite3_column_name(statement, i)];
[entry setObject:columnValue forKey:columnName];
break;
to this to get the float:
case SQLITE_FLOAT:
columnValue = [NSNumber numberWithFloat: sqlite3_column_double(statement, i)];
columnName = [NSString stringWithFormat:@"%s", sqlite3_column_name(statement, i)];
[entry setObject:columnValue forKey:columnName];
break;