нашел простое решение
Код: Выделить всё
public class Sprav_Tariff_Browse extends Activity
{
DecimalFormat myCustDecFormatter = new DecimalFormat("######.00");
...
/*-----------------------------------------------------------------------*/
/* получаем данные в курсор */
/*-----------------------------------------------------------------------*/
@SuppressWarnings("deprecation")
public void refreshCursor()
{
cursor = db.getAllData_Tariff();
//startManagingCursor(cursor);
String f[] = new String[] {kCalcDB.TBL_CATEGORY_NAMECAT, kCalcDB.TBL_TARIFF_TARIFF};
int t[] = new int[] {R.id.textView_Sprav_Tariff_CategoryName_Item, R.id.textView_infoStr};
scAdapter = new SimpleCursorAdapter(this, R.layout.sprav_tariff_item, cursor, f, t)
{
@Override
public void setViewText(TextView v, String text)
{
super.setViewText(v, fmt(v, text));
}
};
lw = (ListView) findViewById(R.id.SpravTariffLW);
lw.setAdapter(scAdapter);
}
/*-----------------------------------------------------------------------*/
/* форматируем число(тариф) в адаптере */
/*-----------------------------------------------------------------------*/
private String fmt(View v, String text)
{
if (v.getId()==R.id.textView_infoStr)
{
Double d = cursor.getDouble(cursor.getColumnIndex(kCalcDB.TBL_TARIFF_TARIFF));
return myCustDecFormatter.format(d);
}
return text;
}
взято отсюда http://androidforums.com/application-de ... tview.html