Skip to content

Commit

Permalink
toString instead of toLocaleString
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor committed Jan 24, 2024
1 parent ded7611 commit 24f3bfa
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/app/components/OrderBook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,14 @@ function CurrentPriceRow() {
// is never null, and is = -1 if there were no trades
let lastPrice = "";
if (trades.length > 0) {
lastPrice = orderBook.lastPrice?.toLocaleString() || "";
lastPrice = orderBook.lastPrice?.toString() || "";
//The full solution causes display issues as it will always display min digits
/*
lastPrice =
orderBook.lastPrice?.toLocaleString(undefined, {
minimumFractionDigits: token2MaxDecimals,
}) || "";
*/
} else {
lastPrice = "No trades have occurred yet";
}
Expand Down Expand Up @@ -105,7 +112,7 @@ function CurrentPriceRow() {
);
} else {
return (
<div className="text-2xl text-left col-span-4 border-r-2 border-accent ml-2">
<div className="text-xl text-left col-span-4 border-r-2 border-accent ml-2">
{lastPrice}
</div>
);
Expand Down

0 comments on commit 24f3bfa

Please sign in to comment.