From aa2ceae79cfb1eda6582671ddbd025cd4764ecfc Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Thu, 14 Oct 2021 21:21:58 +0800 Subject: [PATCH] optimize token format --- src/libs/data/data.js | 2 +- src/views/Staking.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/data/data.js b/src/libs/data/data.js index b7615b9c..d804acad 100644 --- a/src/libs/data/data.js +++ b/src/libs/data/data.js @@ -304,7 +304,7 @@ export function formatTokenAmount(tokenAmount, fraction = 2, denom = 'uatom') { return parseFloat(amount) } -export function formatToken(token, IBCDenom = {}, decimals = 0) { +export function formatToken(token, IBCDenom = {}, decimals = 2) { if (token) { return `${formatTokenAmount(token.amount, decimals, token.denom)} ${formatTokenDenom(IBCDenom[token.denom] || token.denom)}` } diff --git a/src/views/Staking.vue b/src/views/Staking.vue index 2eed896d..7ee6a7d3 100644 --- a/src/views/Staking.vue +++ b/src/views/Staking.vue @@ -232,7 +232,7 @@ export default { methods: { percent, tokenFormatter(amount, denom) { - return formatToken({ amount, denom }) + return formatToken({ amount, denom }, {}, 0) }, rankBadge(data) { const { index, item } = data