MCPcopy Index your code
hub / github.com/Uniswap/interface / formatDelta

Function formatDelta

src/utils/formatNumbers.ts:546–556  ·  view source on GitHub ↗
(delta: Nullish<number>, locale: SupportedLocale = DEFAULT_LOCALE)

Source from the content-addressed store, hash-verified

544
545// Used to format floats representing percent change with fixed decimal places
546function formatDelta(delta: Nullish<number>, locale: SupportedLocale = DEFAULT_LOCALE) {
547 if (delta === null || delta === undefined || delta === Infinity || isNaN(delta)) {
548 return '-'
549 }
550
551 return `${Number(Math.abs(delta).toFixed(2)).toLocaleString(locale, {
552 minimumFractionDigits: 2,
553 maximumFractionDigits: 2,
554 useGrouping: false,
555 })}%`
556}
557
558interface FormatPriceOptions {
559 price: Nullish<Price<Currency, Currency>>

Callers 15

ChartDeltaFunction · 0.85
TokenRowFunction · 0.85
PositionListItemFunction · 0.85
TokenRow.tsxFile · 0.85
LiquidityChartRangeInputFunction · 0.85
PositionPreviewFunction · 0.85
AuthenticatedHeaderFunction · 0.85
TokenRowFunction · 0.85
FeeOptionFunction · 0.85
FeeSelectorFunction · 0.85
StatItemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…