MCPcopy
hub / github.com/Uniswap/interface / formatTickPrice

Function formatTickPrice

src/utils/formatNumbers.ts:591–610  ·  view source on GitHub ↗
({
  price,
  atLimit,
  direction,
  placeholder,
  numberType,
  locale,
  localCurrency,
  conversionRate,
}: FormatTickPriceOptions)

Source from the content-addressed store, hash-verified

589}
590
591function formatTickPrice({
592 price,
593 atLimit,
594 direction,
595 placeholder,
596 numberType,
597 locale,
598 localCurrency,
599 conversionRate,
600}: FormatTickPriceOptions) {
601 if (atLimit[direction]) {
602 return direction === Bound.LOWER ? '0' : '∞'
603 }
604
605 if (!price && placeholder !== undefined) {
606 return placeholder
607 }
608
609 return formatPrice({ price, type: numberType ?? NumberType.TokenNonTx, locale, localCurrency, conversionRate })
610}
611
612interface FormatNumberOrStringOptions {
613 input: Nullish<number | string>

Callers 4

PositionListItemFunction · 0.85
PositionPreviewFunction · 0.85
useFormatterFunction · 0.85
PositionPageContentFunction · 0.85

Calls 1

formatPriceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…