Skip to content

Commit

Permalink
Merge pull request #588 from DeXter-on-Radix/fix_587
Browse files Browse the repository at this point in the history
Fix division by zero error - Issue_587
  • Loading branch information
dcts authored Oct 2, 2024
2 parents 959dcaf + 0a9a885 commit c159342
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 c159342

Please sign in to comment.