From 3e970f70237994a1d89773daecc3965ff18369bc Mon Sep 17 00:00:00 2001 From: "m.ray" <16125548+MadalinaRaicu@users.noreply.github.com> Date: Tue, 1 Nov 2022 11:03:29 +0000 Subject: [PATCH] fix: 1875 & 1876 fix deal ticket fees display and remove insignificant trailing zeros (#1898) --- .../select-market/select-market-columns.tsx | 18 ++++----- .../validate-margin.tsx | 14 ++++--- .../deal-ticket/deal-ticket-fee-details.tsx | 3 +- .../components/deal-ticket/deal-ticket.tsx | 33 +++++++-------- .../src/hooks/use-fee-deal-ticket-details.tsx | 25 ++++++------ .../src/lib/format/number.spec.tsx | 40 +++++++++++++++++-- libs/react-helpers/src/lib/format/number.tsx | 31 ++++++++++++++ 7 files changed, 116 insertions(+), 48 deletions(-) diff --git a/apps/trading/components/select-market/select-market-columns.tsx b/apps/trading/components/select-market/select-market-columns.tsx index 5cfb4cedc..dbe59d483 100644 --- a/apps/trading/components/select-market/select-market-columns.tsx +++ b/apps/trading/components/select-market/select-market-columns.tsx @@ -7,7 +7,7 @@ import { calcCandleVolume, } from '@vegaprotocol/market-list'; import { - addDecimalsFormatNumber, + addDecimalsNormalizeNumber, PriceCell, signedNumberCssClass, t, @@ -236,7 +236,7 @@ export const columns = ( value: market.data?.markPrice ? (

- {`${formatNumber(margin, decimals)} ${symbol} ${t( + {`${normalizeFormatNumber(margin, decimals)} ${symbol} ${t( 'currently required' - )}, ${formatNumber(balance, decimals)} ${symbol} ${t('available')}`} + )}, ${normalizeFormatNumber(balance, decimals)} ${symbol} ${t( + 'available' + )}`}