fix(trading): market info number formatting (#4163)

This commit is contained in:
m.ray 2023-06-23 14:44:18 +03:00 committed by GitHub
parent bb1b236cdf
commit 445a085190
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -182,7 +182,7 @@ describe('market info is displayed', { tags: '@smoke' }, () => {
.contains('Liquidity monitoring parameters')
.click();
validateMarketDataRow(0, 'Triggering Ratio', '0');
validateMarketDataRow(0, 'Triggering Ratio', '0.7');
validateMarketDataRow(1, 'Time Window', '3,600');
validateMarketDataRow(2, 'Scaling Factor', '10');
});

View File

@ -1,6 +1,5 @@
import {
addDecimalsFormatNumber,
formatNumber,
formatNumberPercentage,
} from '@vegaprotocol/utils';
import { t } from '@vegaprotocol/i18n';
@ -47,7 +46,10 @@ const Row = ({
if (asPercentage) {
return formatNumberPercentage(new BigNumber(value).times(100));
}
return `${formatNumber(Number(value))} ${assetSymbol}`;
if (assetSymbol) {
return `${Number(value).toLocaleString()} ${assetSymbol}`;
}
return Number(value).toLocaleString();
};
const formattedValue = getFormattedValue(value);

View File

@ -94,7 +94,7 @@ export const marketInfoQuery = (
},
lpPriceRange: '0.02',
liquidityMonitoringParameters: {
triggeringRatio: '0',
triggeringRatio: '0.7',
targetStakeParameters: {
timeWindow: 3600,
scalingFactor: 10,