Skip to content

Commit

Permalink
fix: balance number decimal (#499)
Browse files Browse the repository at this point in the history
* fix: balance number decimal

* fix: number util
  • Loading branch information
AkydA authored Aug 16, 2024
1 parent 220480d commit 585ff43
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const BalanceTooltipContent: React.FC<BalanceTooltipContentProps> = ({
<span className="position">
{formatPoolPairAmount(balance.balance, {
isKMB: false,
decimals: balance.token.decimals,
})}{" "}
({balance.percent})
</span>
Expand Down
4 changes: 2 additions & 2 deletions packages/web/src/utils/new-number-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ export const formatPoolPairAmount = (
decimals,
decimals ? BigNumber.ROUND_DOWN : undefined,
);
} else {
stringValue = bigNumberValue.toFormat();
}

stringValue = bigNumberValue.toFormat();

const [integerValue,fractionValue] = stringValue.split(".");
if (fractionValue) {
const fractionString = Number(`0.${fractionValue}`).toString().split(".")[1];
Expand Down

1 comment on commit 585ff43

@vercel
Copy link

@vercel vercel bot commented on 585ff43 Aug 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

gnoswap-interface – ./

gnoswap-interface-git-beta-onbloc.vercel.app
beta.gnoswap.io
gnoswap-interface-onbloc.vercel.app

Please sign in to comment.