|
|
@@ -12,7 +12,7 @@ import android.widget.TextView;
|
|
|
import com.xzjmyk.pm.activity.R;
|
|
|
import com.xzjmyk.pm.activity.ui.erp.activity.datainquiry.bean.DataInquiryTotalBean;
|
|
|
|
|
|
-import java.math.BigDecimal;
|
|
|
+import java.text.NumberFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -22,11 +22,14 @@ public class DataInquiryTotalAdapter extends BaseAdapter {
|
|
|
|
|
|
private Context context;
|
|
|
private LayoutInflater layoutInflater;
|
|
|
+ private NumberFormat mNumberFormat;
|
|
|
|
|
|
public DataInquiryTotalAdapter(Context context, List<DataInquiryTotalBean> objects) {
|
|
|
this.context = context;
|
|
|
this.layoutInflater = LayoutInflater.from(context);
|
|
|
this.objects = objects;
|
|
|
+ mNumberFormat = NumberFormat.getInstance();
|
|
|
+ mNumberFormat.setMaximumFractionDigits(2);
|
|
|
}
|
|
|
|
|
|
public List<DataInquiryTotalBean> getObjects() {
|
|
|
@@ -64,7 +67,7 @@ public class DataInquiryTotalAdapter extends BaseAdapter {
|
|
|
|
|
|
private void initializeViews(DataInquiryTotalBean object, ViewHolder holder, int position) {
|
|
|
holder.dataInquiryItemTotalCaption.setText("当前合计" + object.getCaption() + ":");
|
|
|
- holder.dataInquiryItemTotalValue.setText(BigDecimal.valueOf(object.getTotal()) + "");
|
|
|
+ holder.dataInquiryItemTotalValue.setText(mNumberFormat.format(object.getTotal()));
|
|
|
|
|
|
holder.dataInquiryItemTotalDeleteIv.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|