From 834647138f6fcc7dedcea22e59106cafeb8ec398 Mon Sep 17 00:00:00 2001 From: chef-ryan Date: Tue, 7 Jan 2025 15:27:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Fix=20total=20display?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/src/views/Voting/CreateProposal/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/web/src/views/Voting/CreateProposal/index.tsx b/apps/web/src/views/Voting/CreateProposal/index.tsx index 5e954460e669f..8568902ed7d20 100644 --- a/apps/web/src/views/Voting/CreateProposal/index.tsx +++ b/apps/web/src/views/Voting/CreateProposal/index.tsx @@ -22,6 +22,7 @@ import { useToast, useTooltip, } from '@pancakeswap/uikit' +import { formatNumber } from '@pancakeswap/utils/formatNumber' import truncateHash from '@pancakeswap/utils/truncateHash' import snapshot from '@snapshot-labs/snapshot.js' import ConnectWalletButton from 'components/ConnectWalletButton' @@ -91,7 +92,6 @@ const CreateProposal = () => { }) const { total, isLoading } = useGetVotingPower(watch('snapshot')) - console.log(total) const enoughVotingPower = total >= VOTE_THRESHOLD const { @@ -361,7 +361,9 @@ const CreateProposal = () => { {t('Voting Power')} - {isLoading ? '-' : total ?? 0} + + {isLoading ? '-' : formatNumber(total ?? 0, { maxDecimalDisplayDigits: 2 })} + {votingPowerTooltipVisible && votingPowerTooltip}