Skip to content

Commit

Permalink
feat: set precision of token price to 4
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith-CY committed Dec 14, 2022
1 parent bb1acce commit cd0ffb6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pages/token/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { gql } from 'graphql-request'
import dayjs from 'dayjs'
import { Skeleton } from '@mui/material'
import { ConnectorAlreadyConnectedError, useConnect, UserRejectedRequestError } from 'wagmi'
import BigNumber from 'bignumber.js'
import SubpageHead from 'components/SubpageHead'
import PageTitle from 'components/PageTitle'
import Tabs from 'components/Tabs'
Expand Down Expand Up @@ -244,7 +245,9 @@ const Token: React.FC<Props> = () => {
content: token ? (
<div className={styles.price}>
<span>
{token.token_exchange_rate?.exchange_rate ? `$${token.token_exchange_rate?.exchange_rate}` : '-'}
{token.token_exchange_rate?.exchange_rate
? `$${new BigNumber(token.token_exchange_rate?.exchange_rate).precision(4)}`
: '-'}
</span>
<Tooltip
title={t('price-updated-at', {
Expand Down

0 comments on commit cd0ffb6

Please sign in to comment.