code: public static float getFloat(Cursor cursor, String columnName) {
          if (cursor == null) {
              return -1;
          }
  
          return cursor.getFloat(cursor.getColumnIndex(columnName));
      }
docs: Read the float data for the column.
  @see android.database.Cursor#getFloat(int).
  @see android.database.Cursor#getColumnIndex(String).
  @param cursor the cursor.
  @param columnName the column name.
  @return the float value.