Skip to content

Commit

Permalink
fix: display token decimals
Browse files Browse the repository at this point in the history
  • Loading branch information
Tien Nam Dao committed Oct 25, 2022
1 parent 8dff647 commit b218190
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion views/tokens/TokenOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ const TokenOverview = ({ token, tokenData }: Props) => {
<TypographyUI.Balance
size="sm"
currency={tokenData.symbol}
value={tokenData.totalSupply ? convertBalanceToView(tokenData.totalSupply) : 'NaN'}
value={
tokenData.totalSupply
? convertBalanceToView(tokenData.totalSupply, parseInt(tokenData.symbol))
: 'NaN'
}
fixNumber={5}
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion views/tokens/TokenRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function TokenRow({ index, token }: Props) {

<div className={clsx(styles.borderLeft, styles.colTotalSupply, 'padding-left-lg col-3')}>
<span className={clsx('money money-sm money-bold padding-right-xs')}>
{convertBalanceToView(token.totalSupply)}
{convertBalanceToView(token.totalSupply, parseInt(token.decimals))}
</span>
<span className={clsx(styles.currency, 'money money-sm money-bold')}>{token.symbol}</span>
</div>
Expand Down

0 comments on commit b218190

Please sign in to comment.