Skip to content

Commit

Permalink
chore: Revert numbers change
Browse files Browse the repository at this point in the history
  • Loading branch information
garethfuller committed Oct 2, 2024
1 parent 2607c60 commit 8c0e1af
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lib/shared/utils/numbers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function bn(val: Numberish): BigNumber {
return new BigNumber(val.toString())
}

type FormatOpts = { abbreviated?: boolean; preventSmallLabelShow?: boolean }
type FormatOpts = { abbreviated?: boolean }

/**
* Converts a number to a string format within the decimal limit that numeral
Expand Down Expand Up @@ -113,11 +113,8 @@ function aprFormat(apr: Numberish): string {
}

// Formats a slippage value as a percentage.
function slippageFormat(slippage: Numberish, opts?: FormatOpts): string {
if (isSmallPercentage(slippage, { isPercentage: true }) && !opts?.preventSmallLabelShow) {
return SMALL_PERCENTAGE_LABEL
}

function slippageFormat(slippage: Numberish): string {
if (isSmallPercentage(slippage, { isPercentage: true })) return SMALL_PERCENTAGE_LABEL
return numeral(bn(slippage).div(100)).format(SLIPPAGE_FORMAT)
}

Expand Down Expand Up @@ -195,7 +192,7 @@ export function fNum(format: NumberFormat, val: Numberish, opts?: FormatOpts): s
case 'percentage':
return integerPercentageFormat(val)
case 'slippage':
return slippageFormat(val, opts)
return slippageFormat(val)
case 'boost':
return boostFormat(val)
default:
Expand Down

0 comments on commit 8c0e1af

Please sign in to comment.