From 576b45da159291f3b6c8df8cfb58e2d376066540 Mon Sep 17 00:00:00 2001
From: 赵士淞 <zhaoss@yhzhg.cn>
Date: Thu, 09 Feb 2023 09:50:02 +0000
Subject: [PATCH] Merge branch 'zhaoss' of http://192.168.1.110:5678/r/pms-upgrade into master

---
 eladmin-web-master/src/components/Crud/crud.js |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/eladmin-web-master/src/components/Crud/crud.js b/eladmin-web-master/src/components/Crud/crud.js
index f882df4..bfe0be2 100644
--- a/eladmin-web-master/src/components/Crud/crud.js
+++ b/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)

--
Gitblit v1.9.3