Skip to content

Commit

Permalink
fix: return 0 instead of NaN for ltv
Browse files Browse the repository at this point in the history
  • Loading branch information
sakulstra committed Dec 20, 2021
1 parent c2f2414 commit 53f9deb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/modules/dashboard/screens/Dashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,12 @@ export default function Dashboard() {
.div(maxBorrowAmount)
.toFixed();

const loanToValue = valueToBigNumber(user?.totalBorrowsMarketReferenceCurrency || '0')
.dividedBy(user?.totalCollateralMarketReferenceCurrency || '1')
.toFixed();
const loanToValue =
user?.totalCollateralMarketReferenceCurrency === '0'
? '0'
: valueToBigNumber(user?.totalBorrowsMarketReferenceCurrency || '0')
.dividedBy(user?.totalCollateralMarketReferenceCurrency || '1')
.toFixed();

const depositedPositions: DepositTableItem[] = [];
const borrowedPositions: BorrowTableItem[] = [];
Expand Down

0 comments on commit 53f9deb

Please sign in to comment.