您的位置:首页 > 其它

表格内数字按千分位进行格式化

2016-10-17 10:41 627 查看
方法一:



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");
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: