eladmin-web-master/src/components/Crud/crud.js
@@ -604,6 +604,15 @@ if (cents < 10) { cents = '0' + cents } for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++) { num = num.substring(0, num.length - (4 * i + 3)) + ',' + num.substring(num.length - (4 * i + 3)) } return (((sign) ? '' : '-') + num + '.' + cents) }, /** * 最大两位小数格式 * @param {Object} num */ toMaxTwoDecimalPlaces(num) { const numList = num.toString().split('.') num = numList.length > 1 ? numList[1].length > 1 ? num.toFixed(2) : num : num return num } } const crud = Object.assign({}, data)