easyui datagrid 格式化列显示两位小数、千分位


 { field: "contractmoney", title: "合同总价", width: 72, formatter: function (value, row, index) {
                        if (row != null) {
                            return parseFloat(value).toFixed(2);
                        }
                    }
                    },

 

 //二位小数、千分位

 { field: "price", title: "单价", width: 60, align: 'right', formatter: function (value, row, index) {
                                if (row != null) {
                                    return (parseFloat(value).toFixed(2) + '').replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,');
                              }
                              }
                            },

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM