UNPKG

@reservoir0x/relay-kit-ui

Version:

Relay is the Fastest and Cheapest Way to Bridge and Transact Across Chains.

21 lines 1.37 kB
declare function formatDollar(price?: number | null): string; declare function formatNumber(amount: number | null | undefined | string, maximumFractionDigits?: number, compact?: boolean): string; /** * Convert ETH values to human readable formats * @param amount An ETH amount * @param maximumFractionDigits Number of decimal digits * @param decimals Number of decimal digits for the atomic unit * @param compact A boolean value used to specify the formatting notation * @returns returns the ETH value as a `string` or `-` if the amount is `null` or `undefined` */ declare function formatBN(amount: string | number | bigint | null | undefined, maximumFractionDigits: number, decimals?: number, compact?: boolean, formatOptionsParam?: Intl.NumberFormatOptions): string; declare function truncateBalance(balance: string): number; /** * Formats a number represented by a string, ensuring the total length does not exceed a specified number of characters. * @param amount The string to format * @param maxLength The maximum total length of the string representation. * @returns A plain string representation of the number, trimmed to the specified length. */ declare function formatFixedLength(amount: string, maxLength: number): string; export { formatDollar, formatBN, formatFixedLength, formatNumber, truncateBalance }; //# sourceMappingURL=numbers.d.ts.map