From 938d60cea8307f288b697fe96843985822b632f7 Mon Sep 17 00:00:00 2001 From: aleka Date: Mon, 22 Jul 2024 17:54:09 -0400 Subject: [PATCH] fix: fee tier market share percentage should show 1 decimal (#842) --- src/pages/portfolio/Fees.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/pages/portfolio/Fees.tsx b/src/pages/portfolio/Fees.tsx index 21e49c520..71eefa957 100644 --- a/src/pages/portfolio/Fees.tsx +++ b/src/pages/portfolio/Fees.tsx @@ -27,6 +27,8 @@ import { getFeeTiers } from '@/state/configsSelectors'; import { isTruthy } from '@/lib/isTruthy'; +const MARKET_SHARE_PERCENTAGE_FRACTION_DIGITS = 1; + const EQUALITY_SYMBOL_MAP = { '>=': '≥', '<=': '≤', @@ -61,7 +63,11 @@ export const Fees = () => { {isAdditional && stringGetter({ key: STRING_KEYS.AND })}{' '} {stringGetter({ key: STRING_KEYS.EXCHANGE_MARKET_SHARE })}{' '} <$Highlighted>{'>'}{' '} - <$HighlightOutput type={OutputType.Percent} value={totalShare} fractionDigits={0} /> + <$HighlightOutput + type={OutputType.Percent} + value={totalShare} + fractionDigits={MARKET_SHARE_PERCENTAGE_FRACTION_DIGITS} + /> )} {!!makerShare && ( @@ -69,7 +75,11 @@ export const Fees = () => { {isAdditional && stringGetter({ key: STRING_KEYS.AND })}{' '} {stringGetter({ key: STRING_KEYS.MAKER_MARKET_SHARE })}{' '} <$Highlighted>{'>'}{' '} - <$HighlightOutput type={OutputType.Percent} value={makerShare} fractionDigits={0} /> + <$HighlightOutput + type={OutputType.Percent} + value={makerShare} + fractionDigits={MARKET_SHARE_PERCENTAGE_FRACTION_DIGITS} + /> )}