Skip to content

Commit 115754a

Browse files
committed
change numbers formatting on stats
1 parent a78619d commit 115754a

File tree

5 files changed

+16
-28
lines changed

5 files changed

+16
-28
lines changed

src/components/Stats/Liquidity/Liquidity.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { colors, typography } from '@static/theme'
66
import { useStyles } from './style'
77
import { TimeData } from '@store/reducers/stats'
88
import { Grid, Typography } from '@mui/material'
9-
import { formatNumber, formatNumbers, showPrefix } from '@utils/utils'
9+
import { formatNumber } from '@utils/utils'
1010

1111
interface LiquidityInterface {
1212
liquidityPercent: number
@@ -31,8 +31,7 @@ const Liquidity: React.FC<LiquidityInterface> = ({
3131
<Typography className={classes.liquidityHeader}>Liquidity</Typography>
3232
<Grid className={classes.volumePercentHeader}>
3333
<Typography className={classes.volumeLiquidityHeader}>
34-
${formatNumbers()(liquidityVolume.toString())}
35-
{showPrefix(liquidityVolume)}
34+
${formatNumber(liquidityVolume)}
3635
</Typography>
3736
<Grid className={classes.volumeStatusContainer}>
3837
<Grid

src/components/Stats/PoolListItem/PoolListItem.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react'
22
import { theme } from '@static/theme'
33
import { useStyles } from './style'
44
import { Box, Grid, Typography, useMediaQuery } from '@mui/material'
5-
import { addressToTicker, formatNumbers, parseFeeToPathFee, showPrefix } from '@utils/utils'
5+
import { addressToTicker, formatNumber, parseFeeToPathFee } from '@utils/utils'
66
import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown'
77
import ArrowDropUpIcon from '@mui/icons-material/ArrowDropUp'
88
import { useNavigate } from 'react-router-dom'
@@ -137,8 +137,8 @@ const PoolListItem: React.FC<IProps> = ({
137137
</Typography>
138138
) : null} */}
139139
<Typography>{fee}%</Typography>
140-
<Typography>{`$${formatNumbers()(volume.toString())}${showPrefix(volume)}`}</Typography>
141-
<Typography>{`$${formatNumbers()(TVL.toString())}${showPrefix(TVL)}`}</Typography>
140+
<Typography>{`$${formatNumber(volume)}`}</Typography>
141+
<Typography>{`$${formatNumber(TVL)}`}</Typography>
142142
{!isSm && (
143143
<Box className={classes.action}>
144144
<TooltipHover text='Exchange'>

src/components/Stats/TokenListItem/TokenListItem.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown'
44
import ArrowDropUpIcon from '@mui/icons-material/ArrowDropUp'
55
import { useStyles } from './style'
66
import { Grid, Typography, useMediaQuery } from '@mui/material'
7-
import { formatNumbers, showPrefix } from '@utils/utils'
7+
import { formatNumber } from '@utils/utils'
88
import { SortTypeTokenList } from '@store/consts/static'
99

1010
interface IProps {
@@ -57,14 +57,15 @@ const TokenListItem: React.FC<IProps> = ({
5757
{!hideName && <span className={classes.tokenSymbol}>{` (${symbol})`}</span>}
5858
</Typography>
5959
</Grid>
60-
<Typography>{`~$${formatNumbers()(price.toString())}${showPrefix(price)}`}</Typography>
60+
<Typography>{`~$${formatNumber(price)}`}</Typography>
61+
6162
{/* {!hideName && (
6263
<Typography style={{ color: isNegative ? colors.invariant.Error : colors.green.main }}>
6364
{isNegative ? `${priceChange.toFixed(2)}%` : `+${priceChange.toFixed(2)}%`}
6465
</Typography>
6566
)} */}
66-
<Typography>{`$${formatNumbers()(volume.toString())}${showPrefix(volume)}`}</Typography>
67-
<Typography>{`$${formatNumbers()(TVL.toString())}${showPrefix(TVL)}`}</Typography>
67+
<Typography>{`$${formatNumber(volume)}`}</Typography>
68+
<Typography>{`$${formatNumber(TVL)}`}</Typography>
6869
</Grid>
6970
) : (
7071
<Grid

src/components/Stats/Volume/Volume.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { useStyles } from './style'
77
import { TimeData } from '@store/reducers/stats'
88
import { Grid, Typography, useMediaQuery } from '@mui/material'
99
import { Box } from '@mui/system'
10-
import { formatNumber, formatNumbers, showPrefix } from '@utils/utils'
10+
import { formatNumber } from '@utils/utils'
1111

1212
interface StatsInterface {
1313
percentVolume: number
@@ -38,10 +38,7 @@ const Volume: React.FC<StatsInterface> = ({ percentVolume, volume, data, classNa
3838
<Box className={classes.volumeContainer}>
3939
<Typography className={classes.volumeHeader}>Volume</Typography>
4040
<div className={classes.volumePercentContainer}>
41-
<Typography className={classes.volumePercentHeader}>
42-
${formatNumbers()(volume.toString())}
43-
{showPrefix(volume)}
44-
</Typography>
41+
<Typography className={classes.volumePercentHeader}>${formatNumber(volume)}</Typography>
4542
<Box className={classes.volumeStatusContainer}>
4643
<Box
4744
className={classNames(

src/components/Stats/volumeBar/VolumeBar.tsx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import classNames from 'classnames'
33
import { theme } from '@static/theme'
44
import { useStyles } from './style'
55
import { Box, Grid, Typography, useMediaQuery } from '@mui/material'
6-
import { formatNumbers, showPrefix } from '@utils/utils'
6+
import { formatNumber } from '@utils/utils'
77

88
interface Iprops {
99
percentVolume: number
@@ -30,10 +30,7 @@ const VolumeBar: React.FC<Iprops> = ({
3030
<Grid container classes={{ container: classes.container }}>
3131
<Box className={classes.tokenName}>
3232
<Typography className={classes.tokenHeader}>Volume 24H:</Typography>
33-
<Typography className={classes.tokenContent}>
34-
${formatNumbers()(volume.toString())}
35-
{showPrefix(volume)}
36-
</Typography>
33+
<Typography className={classes.tokenContent}>${formatNumber(volume)}</Typography>
3734
{!isXDown && (
3835
<Typography
3936
className={classNames(
@@ -48,10 +45,7 @@ const VolumeBar: React.FC<Iprops> = ({
4845
</Box>
4946
<Box className={classes.tokenName}>
5047
<Typography className={classes.tokenHeader}>TVL 24H:</Typography>
51-
<Typography className={classes.tokenContent}>
52-
${formatNumbers()(tvlVolume.toString())}
53-
{showPrefix(tvlVolume)}
54-
</Typography>
48+
<Typography className={classes.tokenContent}>${formatNumber(tvlVolume)}</Typography>
5549
{!isXDown && (
5650
<Typography
5751
className={classNames(
@@ -64,10 +58,7 @@ const VolumeBar: React.FC<Iprops> = ({
6458
</Box>
6559
<Box className={classes.tokenName}>
6660
<Typography className={classes.tokenHeader}>Fees 24H:</Typography>
67-
<Typography className={classes.tokenContent}>
68-
${formatNumbers()(feesVolume.toString())}
69-
{showPrefix(feesVolume)}
70-
</Typography>
61+
<Typography className={classes.tokenContent}>${formatNumber(feesVolume)}</Typography>
7162
{!isXDown && (
7263
<Typography
7364
className={classNames(

0 commit comments

Comments
 (0)