Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toString instead of toLocaleString #226

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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