Skip to content

Commit f43eb49

Browse files
authored
fix: replace nan with 0 (#59)
* fix: replace nan with 0 * Update usePoolLists.ts
1 parent b12d068 commit f43eb49

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/hooks/usePoolLists.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ current: boolean): BigNumber => {
6464
.div(new BigNumber(10).pow(decimals2))
6565
.multipliedBy(tokenPrices[token2]);
6666

67-
return dv1.plus(dv2);
67+
return dv1.plus(dv2).toString()=="NaN"? new BigNumber(0) :dv1.plus(dv2);
6868
};
6969

7070
const calculateVolumeChange = (pool: PoolListItem, tokenPrices: TokenPrices): number => {
@@ -106,7 +106,7 @@ const calculateUserLiquidity = (
106106
.multipliedBy(tokenPrices[token2]);
107107
const res = v1.plus(v2);
108108

109-
return res.gt(0) ? res.toFormat(2) : undefined;
109+
return res.gt(0) ? res.toFormat(2) : "0";
110110
};
111111

112112
const getUserPoolList = (queryType: PoolQueryType, limit: number, offset: number, search: string, signerAddress: string): PoolQueryObject => ({

0 commit comments

Comments
 (0)