Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code>SELECT _id, name, ROUND(amount,2) FROM accounts </code></pre> <p>Following code will give you idea how you can do it</p> <pre> public class TestListView extends ListActivity { ... private DecimalFormat myCustDecFormatter = new DecimalFormat("########.00"); ... ... /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { ... ... ... } private void fillData() { /* Get all of the rows from the database and create the item list */ /* for mult accts, pass in acct name? */ mEntryCursor = mDbHelper.fetchAllEntries(); startManagingCursor(mEntryCursor); // Create an array to specify the fields we want to display in the list (only TITLE) String[] from = new String[]{myDbAdapter.KEY_NMBR,myDbAdapter.KEY_DATE,myDbAdapter.KEY_DESCR,myDbAdapter.KEY_AMT}; // and an array of the fields we want to bind those fields to (in this case just text1) int[] to = new int[]{R.id.txtnmbr, R.id.txtdate, R.id.txtdescr, R.id.txtamt}; // Now create a simple cursor adapter and set it to display setListAdapter(new SimpleCursorAdapter(this, R.layout.entryrow, mEntryCursor, from, to) { @Override public void setViewText(TextView v, String text) { super.setViewText(v, convText(v, text)); } }); } private String convText(TextView v, String text) { switch (v.getId()) { case R.id.txtamt: double dblAmt; //dblAmt = Double.valueOf(text); dblAmt = mEntryCursor.getDouble(AMT_COLUMN); return myCustDecFormatter.format(dblAmt); } return text; } }//end TestListView </pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload