You should use the appropriate Cursor
get
method. e.g. instead of
String balance = getString(getColumnIndex(DebtTable.Cols.balance));
You could use:-
String balance = Double.toString(csr.getDouble(DebtTable.Cols.balance));
or perhaps :-
String balance = NumberFormat.getCurrencyInstance().format(csr.getDouble(DebtTable.Cols.balance));
Here's an example from How flexible/restricive are SQLite column types? that shows how the different get methods retrieve data (i.e VALUE AS ???? eqautes to method would be get????
):-
For Double myREAL = 213456789.4528791134567890109643534276; :-
08-08 09:19:03.658 13575-13575/mjt.soqanda D/ColTypes: Column=REAL_COL<<
08-08 09:19:03.658 13575-13575/mjt.soqanda D/ColTypes: VALUE AS INT >>213456789<<
08-08 09:19:03.658 13575-13575/mjt.soqanda D/ColTypes: VALUE AS LONG >>213456789<<
08-08 09:19:03.658 13575-13575/mjt.soqanda D/ColTypes: VALUE AS STRING >>2.13457e+08<<
08-08 09:19:03.658 13575-13575/mjt.soqanda D/ColTypes: VALUE AS DOUBLE >>2.134567894528791E8<<
08-08 09:19:03.658 13575-13575/mjt.soqanda D/ColTypes: VALUE AS FLOAT >>2.1345678E8<<
08-08 09:19:03.658 13575-13575/mjt.soqanda D/ColTypes: VALUE AS SHORT >>6037<<
08-08 09:19:03.658 13575-13575/mjt.soqanda D/ColTypes: Unable to handle with getBlob.