diff --git a/apps/marginfi-v2-ui/src/components/Staking/StakingCard/StakingCard.tsx b/apps/marginfi-v2-ui/src/components/Staking/StakingCard/StakingCard.tsx index d22d0d048e..4b1f886928 100644 --- a/apps/marginfi-v2-ui/src/components/Staking/StakingCard/StakingCard.tsx +++ b/apps/marginfi-v2-ui/src/components/Staking/StakingCard/StakingCard.tsx @@ -21,6 +21,7 @@ import { SettingsModal } from "./SettingsModal"; import { SettingsIcon } from "./SettingsIcon"; const SOL_MINT = new PublicKey("So11111111111111111111111111111111111111112"); +const LST_FORMATTER = makeTokenAmountFormatter(9); export interface TokenData { mint: PublicKey; @@ -333,13 +334,13 @@ export const StakingCard: FC = () => {
You will receive - {lstOutAmount ? numeralFormatter(lstOutAmount) : "-"} $LST + {lstOutAmount !== null && selectedMintInfo ? LST_FORMATTER.format(lstOutAmount) : "-"} $LST
{swapping ? ( @@ -441,3 +442,11 @@ async function depositToken( return sig; } + +function makeTokenAmountFormatter(decimals: number) { + return new Intl.NumberFormat("en-US", { + useGrouping: true, + minimumFractionDigits: 0, + maximumFractionDigits: decimals, + }) +}