From 3ffcc90dd2ca0082449754684e065d8a0e73a3df Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Mon, 30 Oct 2023 09:19:34 +0800 Subject: [PATCH] fix: small number of commission & rewards --- src/stores/useFormatter.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/stores/useFormatter.ts b/src/stores/useFormatter.ts index 7f74c317..f45c61c5 100644 --- a/src/stores/useFormatter.ts +++ b/src/stores/useFormatter.ts @@ -259,7 +259,10 @@ export const useFormatter = defineStore('formatter', { if(amount < 0.01) { fmt = '0.[000000]' } - + if(amount < 0.000001) { + return `0 ${denom.substring(0, 10)}`; + } + console.log("amount:", amount, numeral(amount).format(fmt)) return `${numeral(amount).format(fmt)} ${ withDenom ? denom.substring(0, 10) : '' }`;