feat(market-depth): always show the same number of decimal places in order book (#3317)

This commit is contained in:
Bartłomiej Głownia 2023-03-30 11:54:13 +02:00 committed by GitHub
parent d7404bcd76
commit 77ada964b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,5 @@
import React from 'react';
import { addDecimalsFormatNumber } from '@vegaprotocol/utils';
import { addDecimalsFixedFormatNumber } from '@vegaprotocol/utils';
import { PriceCell, VolCell, CumulativeVol } from '@vegaprotocol/datagrid';
interface OrderbookRowProps {
@ -39,14 +39,20 @@ export const OrderbookRow = React.memo(
<VolCell
testId={`bid-vol-${price}`}
value={bid}
valueFormatted={addDecimalsFormatNumber(bid, positionDecimalPlaces)}
valueFormatted={addDecimalsFixedFormatNumber(
bid,
positionDecimalPlaces
)}
relativeValue={relativeBid}
type="bid"
/>
<VolCell
testId={`ask-vol-${price}`}
value={ask}
valueFormatted={addDecimalsFormatNumber(ask, positionDecimalPlaces)}
valueFormatted={addDecimalsFixedFormatNumber(
ask,
positionDecimalPlaces
)}
relativeValue={relativeAsk}
type="ask"
/>
@ -54,7 +60,7 @@ export const OrderbookRow = React.memo(
testId={`price-${price}`}
value={BigInt(price)}
onClick={() => onClick && onClick(price)}
valueFormatted={addDecimalsFormatNumber(price, decimalPlaces)}
valueFormatted={addDecimalsFixedFormatNumber(price, decimalPlaces)}
/>
<CumulativeVol
testId={`cumulative-vol-${price}`}