Skip to content

Commit

Permalink
Merge pull request #663 from subquery/feat/update-ratio
Browse files Browse the repository at this point in the history
feat: update display ratio
  • Loading branch information
HuberTRoy authored Feb 23, 2024
2 parents 0eb92f9 + 8b778c8 commit 30c2574
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pages/swapksqt/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const SwapKsqtInner: FC = () => {
if (res) {
const [_, __, amountGive, amountGet] = res;

const ratio = BigNumber(amountGet.toString()).div(amountGive.toString());
const ratio = BigNumber(amountGive.toString()).div(amountGet.toString());
if (ratio.toFixed() !== 'NaN') {
return ratio.toFixed();
}
Expand Down Expand Up @@ -298,7 +298,9 @@ const SwapKsqtInner: FC = () => {

<div className={styles.bottom}>
<Typography variant="large" weight={600} type="secondary">
{formatEther(balance.data, 4)}
{BigNumber(formatEther(balance.data, 4).toString() || '0')
.multipliedBy(tradeRadio.data?.toString() || '1.83')
.toFixed(4)}
</Typography>
</div>
</div>
Expand Down

0 comments on commit 30c2574

Please sign in to comment.