Skip to content

Commit

Permalink
fix: fee tier market share percentage should show 1 decimal (#842)
Browse files Browse the repository at this point in the history
  • Loading branch information
aforaleka authored Jul 22, 2024
1 parent 6e677ae commit 938d60c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/pages/portfolio/Fees.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
'>=': '≥',
'<=': '≤',
Expand Down Expand Up @@ -61,15 +63,23 @@ export const Fees = () => {
{isAdditional && stringGetter({ key: STRING_KEYS.AND })}{' '}
{stringGetter({ key: STRING_KEYS.EXCHANGE_MARKET_SHARE })}{' '}
<$Highlighted>{'>'}</$Highlighted>{' '}
<$HighlightOutput type={OutputType.Percent} value={totalShare} fractionDigits={0} />
<$HighlightOutput
type={OutputType.Percent}
value={totalShare}
fractionDigits={MARKET_SHARE_PERCENTAGE_FRACTION_DIGITS}
/>
</$AdditionalConditionsText>
)}
{!!makerShare && (
<$AdditionalConditionsText>
{isAdditional && stringGetter({ key: STRING_KEYS.AND })}{' '}
{stringGetter({ key: STRING_KEYS.MAKER_MARKET_SHARE })}{' '}
<$Highlighted>{'>'}</$Highlighted>{' '}
<$HighlightOutput type={OutputType.Percent} value={makerShare} fractionDigits={0} />
<$HighlightOutput
type={OutputType.Percent}
value={makerShare}
fractionDigits={MARKET_SHARE_PERCENTAGE_FRACTION_DIGITS}
/>
</$AdditionalConditionsText>
)}
</$AdditionalConditions>
Expand Down

0 comments on commit 938d60c

Please sign in to comment.