Skip to content

Commit

Permalink
Fix more number formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
csillag committed Apr 26, 2023
1 parent 01daa94 commit 71769f8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/app/components/Account/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => ({
'&&': {
Expand Down Expand Up @@ -95,7 +96,7 @@ export const Account: FC<AccountProps> = ({ account, isLoading, roseFiatValue, s
)}

<dt>{t('common.transactions')}</dt>
<dd>{account.stats.num_txns}</dd>
<dd>{formatNumber(account.stats.num_txns)}</dd>

<dt>{t('account.evmTokens')}</dt>
<dd>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/Blocks/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const Blocks = (props: BlocksProps) => {
},
{
align: TableCellAlign.Right,
content: block.num_transactions,
content: formatNumber(block.num_transactions),
key: 'txs',
},
...(verbose
Expand Down
11 changes: 3 additions & 8 deletions src/app/pages/BlockDetailPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,9 @@ export const BlockDetailView: FC<{
<dt>{t('common.size')}</dt>
<dd>
{t('common.bytes', {
value: block.size,
formatParams: {
value: {
style: 'unit',
unit: 'byte',
unitDisplay: 'long',
} satisfies Intl.NumberFormatOptions,
},
value: formatNumber(block.size, {
unit: 'byte',
}),
})}
</dd>

Expand Down

0 comments on commit 71769f8

Please sign in to comment.