Skip to content

Commit

Permalink
Fix division by error error
Browse files Browse the repository at this point in the history
  • Loading branch information
yuliaSharabi committed Sep 30, 2024
1 parent a992a80 commit 4adbf7e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app/components/OrderBook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,10 @@ function RecentTradesTab() {
</thead>

{lastTrades.map((trade, indx) => {
const price = Calculator.divide(
trade.token2Amount,
trade.token1Amount
);
const price =
trade.token1Amount === 0
? 0
: Calculator.divide(trade.token2Amount, trade.token1Amount);
const time = trade.timestamp.split("T").join(" ").split(":00.")[0];
const amount = Math.round(trade.token1Amount);
return (
Expand Down

0 comments on commit 4adbf7e

Please sign in to comment.