方法一:
DisplayInputFormat.DisplayInputFormat(webBean, "DepositAmountTE", ON_SUBMIT_VALIDATER_ATTR);
public static void DisplayInputFormat(OAWebBean webBean,String lv_findchild,oracle.cabo.ui.AttributeKey key) { //Added by Tommy on 2012-09-08 for REQ031. //数字格式化 Formatter formatter = new OADecimalValidater("#,###,###,##0.00;-#,###,###,##0.00", "#,###,###,##0.00;-#,###,###,##0.00"); OAMessageTextInputBean lv_item1 = (OAMessageTextInputBean)webBean.findChildRecursive(lv_findchild); if (lv_item1 != null) lv_item1.setAttributeValue(key, formatter); }
但是此方法有个问题,若表格中有合计值,合计无法被格式化
方法二:使用币种格式化处理
OAWebBean DepositAmountTEBean = webBean.findChildRecursive("DepositAmountTE"); if (DepositAmountTEBean != null) { DepositAmountTEBean.setAttributeValue(OAWebBeanConstants.CURRENCY_CODE, "CNY"); }
时间: 2024-11-10 13:13:00