Skip to content

Commit

Permalink
add formatting to APR display
Browse files Browse the repository at this point in the history
  • Loading branch information
benwolski committed Nov 12, 2024
1 parent bc37a08 commit b6ae459
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/pages/platformAmbient/Vaults/VaultRow/VaultRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import styles from './VaultRow.module.css';
import tempestLogoColor from './tempestLogoColor.svg';
// import tempestLogo from './tempestLogo.svg';
import { FlexContainer } from '../../../../styled/Common';
import { uriToHttp } from '../../../../ambient-utils/dataLayer';
import {
getFormattedNumber,
uriToHttp,
} from '../../../../ambient-utils/dataLayer';
import TokenIcon from '../../../../components/Global/TokenIcon/TokenIcon';
import useMediaQuery from '../../../../utils/hooks/useMediaQuery';
import { useModal } from '../../../../components/Global/Modal/useModal';
Expand Down Expand Up @@ -103,6 +106,14 @@ export default function VaultRow(props: propsIF) {
</div>
);

const formattedAPR = getFormattedNumber({
value: parseFloat(vault.apr),
prefix: '',
suffix: '%',
minFracDigits: 2,
maxFracDigits: 2,
});

return (
<>
<div id={idForDOM} className={styles.mainContainer}>
Expand All @@ -121,7 +132,7 @@ export default function VaultRow(props: propsIF) {
className={styles.apyDisplay}
style={{ color: 'var(--other-green' }}
>
{`${vault.apr}%`}
{formattedAPR}
</p>
<div className={styles.actionButtonContainer}>
<button
Expand Down

0 comments on commit b6ae459

Please sign in to comment.