diff --git a/src/app/components/OrderBook.tsx b/src/app/components/OrderBook.tsx index d2dd52d7..d9ab6cf1 100644 --- a/src/app/components/OrderBook.tsx +++ b/src/app/components/OrderBook.tsx @@ -61,19 +61,16 @@ function CurrentPriceRow() { ); let spreadString = ""; + let spreadValue = ""; // checking for past trades here because adexState.currentPairInfo.lastPrice // is never null, and is = -1 if there were no trades let lastPrice = ""; if (trades.length > 0) { - lastPrice = orderBook.lastPrice?.toString() || ""; - //The full solution causes display issues as it will always display min digits - /* - lastPrice = - orderBook.lastPrice?.toLocaleString(undefined, { - minimumFractionDigits: token2MaxDecimals, - }) || ""; - */ + lastPrice = utils.displayNumber( + orderBook.lastPrice || 0, + CHARACTERS_TO_DISPLAY + ); } else { lastPrice = "No trades have occurred yet"; } @@ -93,20 +90,22 @@ function CurrentPriceRow() { 2 ); - spreadString = `${spread} (${spreadPercent}%)`; + spreadString = `(${spreadPercent}%)`; + spreadValue = `Spread ${spread}`; } return ( <> -