From e1fcbf930f423388b80fb023184d314cf1db86a2 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 22 May 2017 15:38:10 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B2=BE=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bi/core.js | 2 +- docs/core.js | 2 +- src/core/proto/number.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bi/core.js b/bi/core.js index de5f6d5d1f..2cd75c8d9d 100644 --- a/bi/core.js +++ b/bi/core.js @@ -6857,7 +6857,7 @@ function accDiv(arg1, arg2) { with (Math) { r1 = Number(arg1.toString().replace(".", "")); r2 = Number(arg2.toString().replace(".", "")); - return (r1 / r2) * pow(10, t2 - t1); + return (t2 > t1) ? (r1 / r2) * pow(10, t2 - t1) : (r1 / r2) / pow(10, t1 - t2); } } diff --git a/docs/core.js b/docs/core.js index 4b80066049..2111af08a7 100644 --- a/docs/core.js +++ b/docs/core.js @@ -24390,7 +24390,7 @@ function accDiv(arg1, arg2) { with (Math) { r1 = Number(arg1.toString().replace(".", "")); r2 = Number(arg2.toString().replace(".", "")); - return (r1 / r2) * pow(10, t2 - t1); + return (t2 > t1) ? (r1 / r2) * pow(10, t2 - t1) : (r1 / r2) / pow(10, t1 - t2); } } diff --git a/src/core/proto/number.js b/src/core/proto/number.js index 4a002b71b9..45f5656e64 100644 --- a/src/core/proto/number.js +++ b/src/core/proto/number.js @@ -259,7 +259,7 @@ function accDiv(arg1, arg2) { with (Math) { r1 = Number(arg1.toString().replace(".", "")); r2 = Number(arg2.toString().replace(".", "")); - return (r1 / r2) * pow(10, t2 - t1); + return (t2 > t1) ? (r1 / r2) * pow(10, t2 - t1) : (r1 / r2) / pow(10, t1 - t2); } }