Java tutorial
//package com.java2s; //License from project: Apache License import android.database.Cursor; public class Main { public static float floatFromCursor(Cursor c, String field) { if (c.isNull(c.getColumnIndex(field))) { return -1; } return c.getFloat(c.getColumnIndex(field)); } }