首页 > 其他 > 详细

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

时间:2016-10-17 11:06:33      阅读:121      评论:0      收藏:0      [点我收藏+]

方法一:

技术分享

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");
            }                

 

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

原文:http://www.cnblogs.com/huanghongbo/p/5968900.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!