From 71769f8fe65a617745f2c7aaf170d2de4680b66a Mon Sep 17 00:00:00 2001 From: Kristof Csillag Date: Wed, 26 Apr 2023 17:03:40 +0200 Subject: [PATCH] Fix more number formatting --- src/app/components/Account/index.tsx | 3 ++- src/app/components/Blocks/index.tsx | 2 +- src/app/pages/BlockDetailPage/index.tsx | 11 +++-------- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/app/components/Account/index.tsx b/src/app/components/Account/index.tsx index a1547de75a..ec8b6eb9d7 100644 --- a/src/app/components/Account/index.tsx +++ b/src/app/components/Account/index.tsx @@ -13,6 +13,7 @@ import { TextSkeleton } from '../../components/Skeleton' import { type RuntimeAccount } from '../../../oasis-indexer/api' import { TokenPills } from './TokenPills' import { AccountLink } from './AccountLink' +import { formatNumber } from '../../utils/numberFormatter' export const StyledAvatarContainer = styled('dt')(({ theme }) => ({ '&&': { @@ -95,7 +96,7 @@ export const Account: FC = ({ account, isLoading, roseFiatValue, s )}
{t('common.transactions')}
-
{account.stats.num_txns}
+
{formatNumber(account.stats.num_txns)}
{t('account.evmTokens')}
diff --git a/src/app/components/Blocks/index.tsx b/src/app/components/Blocks/index.tsx index 22bafe4a59..0e4ca9ccac 100644 --- a/src/app/components/Blocks/index.tsx +++ b/src/app/components/Blocks/index.tsx @@ -67,7 +67,7 @@ export const Blocks = (props: BlocksProps) => { }, { align: TableCellAlign.Right, - content: block.num_transactions, + content: formatNumber(block.num_transactions), key: 'txs', }, ...(verbose diff --git a/src/app/pages/BlockDetailPage/index.tsx b/src/app/pages/BlockDetailPage/index.tsx index 613ccd436b..721e571ec9 100644 --- a/src/app/pages/BlockDetailPage/index.tsx +++ b/src/app/pages/BlockDetailPage/index.tsx @@ -102,14 +102,9 @@ export const BlockDetailView: FC<{
{t('common.size')}
{t('common.bytes', { - value: block.size, - formatParams: { - value: { - style: 'unit', - unit: 'byte', - unitDisplay: 'long', - } satisfies Intl.NumberFormatOptions, - }, + value: formatNumber(block.size, { + unit: 'byte', + }), })}