From 84b891516df106db3c93dfebc1cd5a6bc869d848 Mon Sep 17 00:00:00 2001 From: joeyoyo <549400805@qq.com> Date: Tue, 12 Nov 2019 16:09:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E5=AD=97=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- html/wallet/js/wallet.api.js | 1 + lib/js/app.js | 27 ++++++++++++++------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/html/wallet/js/wallet.api.js b/html/wallet/js/wallet.api.js index 181f6c3..1304827 100644 --- a/html/wallet/js/wallet.api.js +++ b/html/wallet/js/wallet.api.js @@ -180,6 +180,7 @@ define(['mui', 'app', 'ajaxUtil', 'jsencrypt'], function(mui, app, ajaxUtil, jse * @param {Object} coins */ function moduleType(type, coin) { + console.log(JSON.stringify(coin)); coin.moduleType = type; coin.balance = app.formatValue(coin.balance); coin.freeBalance = app.formatValue(coin.freeBalance); diff --git a/lib/js/app.js b/lib/js/app.js index bacc47a..dc020d2 100644 --- a/lib/js/app.js +++ b/lib/js/app.js @@ -678,23 +678,24 @@ val = -val; } if(val < 0.0001) { - value = compute.Mul(value, 1e8, 8); - value = compute.Div(value, 1e8, 8); - value = value.toFixed(8); + val = compute.Mul(val, 1e8, 8); + val = compute.Div(val, 1e8, 8); + val = val.toFixed(8); } else if(val < 0.1) { - value = compute.Mul(value, 1e6, 6); - value = compute.Div(value, 1e6, 6); - value = value.toFixed(6); + val = compute.Mul(val, 1e6, 6); + val = compute.Div(val, 1e6, 6); + val = val.toFixed(6); } else if(val < 10) { - value = compute.Mul(value, 1e4, 4); - value = compute.Div(value, 1e4, 4); - value = value.toFixed(4); + val = compute.Mul(val, 1e4, 4); + val = compute.Div(val, 1e4, 4); + val = val.toFixed(4); } else { - value = compute.Mul(value, 1e2, 2); - value = compute.Div(value, 1e2, 2); - value = value.toFixed(2); + val = compute.Mul(val, 1e2, 2); + val = compute.Div(val, 1e2, 2); + val = val.toFixed(2); + console.log(val); } - return value; + return val; } /***