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