保留两位小数

1.js:

object.list[i].totolmoney=Math.round((object.list[i].totalMoney/10000) * 100) / 100

2.java 

    Double d = (new Double((Double) listExcell.get(i).get(
                        "totolmoney")));
                
                
                
                String dis;
                if(d>1000){
                    
                    
                  dis=String.format("%.2f", (d/10000))+"万元";
                }
                else{
                  dis=d+"元";
                }

猜你喜欢

转载自my.oschina.net/18829297883/blog/1813890