From 8793fa15c0e43b0b7df6df6aa96566c321337026 Mon Sep 17 00:00:00 2001 From: donqi Date: Wed, 1 Feb 2023 20:49:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9C=8D=E5=8A=A1=E4=BB=B7?= =?UTF-8?q?=E6=A0=BC=E6=8F=90=E7=A4=BA=E5=86=85=E5=AE=B9=E9=9A=8F=E7=B1=BB?= =?UTF-8?q?=E7=9B=AE=E6=89=A3=E7=82=B9=E8=AE=BE=E7=BD=AE=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/js/calcUtil.js | 5 +++++ main.js | 2 ++ pages/my/new-serv.vue | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 common/js/calcUtil.js diff --git a/common/js/calcUtil.js b/common/js/calcUtil.js new file mode 100644 index 0000000..3529ca5 --- /dev/null +++ b/common/js/calcUtil.js @@ -0,0 +1,5 @@ +export default { + curNumPlaces(num, places) { + return String(num).substring(0, String(num).indexOf(".") + places) + } +} \ No newline at end of file diff --git a/main.js b/main.js index b074731..44b9868 100644 --- a/main.js +++ b/main.js @@ -7,6 +7,7 @@ import Data from './common/js/data.js'; import globalFun from './common/js/glogalFun.js'; import validate from './common/js/validate.js'; import dateUtil from './common/js/dateUtil.js'; +import calcUtil from './common/js/calcUtil.js'; import commonFun from './common/js/commonFun.js'; import request from './common/js/request.js'; import globalData from './common/js/globalData.js'; @@ -38,6 +39,7 @@ Vue.prototype.$globalData = globalData; Vue.prototype.$globalFun = globalFun; Vue.prototype.$validate = validate; Vue.prototype.$dateUtil = dateUtil; +Vue.prototype.$calcUtil = calcUtil; Vue.prototype.$commonFun = commonFun; Vue.prototype.$request = request; diff --git a/pages/my/new-serv.vue b/pages/my/new-serv.vue index 83c6578..495554d 100644 --- a/pages/my/new-serv.vue +++ b/pages/my/new-serv.vue @@ -45,7 +45,8 @@ * - +