fix(trading): volumes formatting (#3293)
This commit is contained in:
parent
d8aac83f2d
commit
6854980b32
@ -39,7 +39,7 @@ describe('market info is displayed', { tags: '@smoke' }, () => {
|
||||
it('market volume displayed', () => {
|
||||
cy.getByTestId(marketTitle).contains('Market volume').click();
|
||||
validateMarketDataRow(0, '24 Hour Volume', '1');
|
||||
validateMarketDataRow(1, 'Open Interest', '0');
|
||||
validateMarketDataRow(1, 'Open Interest', '-');
|
||||
validateMarketDataRow(2, 'Best Bid Volume', '1');
|
||||
validateMarketDataRow(3, 'Best Offer Volume', '3');
|
||||
validateMarketDataRow(4, 'Best Static Bid Volume', '2');
|
||||
|
@ -106,7 +106,7 @@ export const MarketInfoTable = ({
|
||||
decimalPlaces={decimalPlaces}
|
||||
assetSymbol={assetSymbol}
|
||||
asPercentage={asPercentage}
|
||||
unformatted={unformatted || key.toLowerCase().includes('volume')}
|
||||
unformatted={unformatted}
|
||||
noBorder={noBorder}
|
||||
/>
|
||||
))}
|
||||
|
@ -96,21 +96,19 @@ export const MarketVolumeInfoPanel = ({
|
||||
...props
|
||||
}: MarketInfoWithDataAndCandlesProps & PanelProps) => {
|
||||
const last24hourVolume = market.candles && calcCandleVolume(market.candles);
|
||||
|
||||
const dash = (value: string | undefined) =>
|
||||
value && value !== '0' ? value : '-';
|
||||
|
||||
return (
|
||||
<MarketInfoTable
|
||||
data={{
|
||||
'24hourVolume':
|
||||
last24hourVolume && last24hourVolume !== '0'
|
||||
? addDecimalsFormatNumber(
|
||||
last24hourVolume,
|
||||
market.positionDecimalPlaces
|
||||
)
|
||||
: '-',
|
||||
openInterest: market.data?.openInterest,
|
||||
bestBidVolume: market.data?.bestBidVolume,
|
||||
bestOfferVolume: market.data?.bestOfferVolume,
|
||||
bestStaticBidVolume: market.data?.bestStaticBidVolume,
|
||||
bestStaticOfferVolume: market.data?.bestStaticOfferVolume,
|
||||
'24hourVolume': dash(last24hourVolume),
|
||||
openInterest: dash(market.data?.openInterest),
|
||||
bestBidVolume: dash(market.data?.bestBidVolume),
|
||||
bestOfferVolume: dash(market.data?.bestOfferVolume),
|
||||
bestStaticBidVolume: dash(market.data?.bestStaticBidVolume),
|
||||
bestStaticOfferVolume: dash(market.data?.bestStaticOfferVolume),
|
||||
}}
|
||||
decimalPlaces={market.positionDecimalPlaces}
|
||||
{...props}
|
||||
|
Loading…
Reference in New Issue
Block a user