({
price,
type = NumberType.FiatTokenPrice,
locale = DEFAULT_LOCALE,
localCurrency = DEFAULT_LOCAL_CURRENCY,
conversionRate,
}: FormatPriceOptions)
| 564 | } |
| 565 | |
| 566 | function formatPrice({ |
| 567 | price, |
| 568 | type = NumberType.FiatTokenPrice, |
| 569 | locale = DEFAULT_LOCALE, |
| 570 | localCurrency = DEFAULT_LOCAL_CURRENCY, |
| 571 | conversionRate, |
| 572 | }: FormatPriceOptions): string { |
| 573 | if (price === null || price === undefined) { |
| 574 | return '-' |
| 575 | } |
| 576 | |
| 577 | return formatNumber({ input: parseFloat(price.toSignificant()), type, locale, localCurrency, conversionRate }) |
| 578 | } |
| 579 | |
| 580 | interface FormatTickPriceOptions { |
| 581 | price?: Price<Token, Token> |
no test coverage detected
searching dependent graphs…