From ee65c642869950908510fe4a76571044cf8cc03f Mon Sep 17 00:00:00 2001 From: caolc <572275724@qq.com> Date: Wed, 2 Nov 2022 22:56:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=B7=E6=A0=BC=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/site-item/site-item.vue | 2 +- main.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/site-item/site-item.vue b/components/site-item/site-item.vue index 4ed87b9..35ea980 100644 --- a/components/site-item/site-item.vue +++ b/components/site-item/site-item.vue @@ -159,7 +159,7 @@ // console.log('old:',value) // console.log('new:',realAmount) // return realAmount - return String(value).split('.')[1]&&String(value).split('.')[1].length>2? Number(`${String(value).split('.')[0]}.${String(value).split('.')[1].substring(0,1)}${ Number(String(value).split('.')[1].substring(1,2)) + 1}`) :Number(value).toFixed(2); + return String(value).split('.')[1]&&String(value).split('.')[1].length>2?Number(`${String(value).split('.')[0]}.${String(value).split('.')[1].substring(0,2)}${Number(String(value).split('.')[1].substr(2))==0?'':9}`).toFixed(2) :Number(value).toFixed(2); } else { return '0.00' } diff --git a/main.js b/main.js index 6892162..b1b6784 100644 --- a/main.js +++ b/main.js @@ -88,7 +88,7 @@ Vue.prototype.olitype = function(value){ } Vue.prototype.moneyIntercept = function(value){ if (value != 'xxx.x') { - return String(value).split('.')[1]&&String(value).split('.')[1].length>2? Number(`${String(value).split('.')[0]}.${String(value).split('.')[1].substring(0,1)}${ Number(String(value).split('.')[1].substring(1,2)) + 1}`) :Number(value).toFixed(2); + return String(value).split('.')[1]&&String(value).split('.')[1].length>2?Number(`${String(value).split('.')[0]}.${String(value).split('.')[1].substring(0,2)}${Number(String(value).split('.')[1].substr(2))==0?'':9}`).toFixed(2) :Number(value).toFixed(2); } else { return Number(value).toFixed(2) }