interface FormatNumberOptions { /** Numbers smaller than this will be converted to scientific notation */ minBeforeUseScientific?: number; /** If the number part for suffixed # is >= this, will use sci notation (e.g. 1,000M -> 1E3M) */ maxNumberPartSizeForSuffix?: number; /** The amount of decimal places to truncate to when softly truncating (to specify decimal places for suffix-truncation, e.g. 1.23M, use decimalPrecisionForSuffix) */ softDecimalPrecision?: number; /** Numbers >= this will have their decimals truncated aggressively */ maxBeforeAggresiveDecimalTruncation?: number; /** The amount of decimal places to truncate to when aggressively truncating (to specify decimal places for suffix-truncation, e.g. 1.23M, use decimalPrecisionForSuffix) */ aggresiveDecimalPrecision?: number; /** Numbers >= this will have a suffix added during truncation (e.g. 1.23M) */ maxBeforeUseSuffix?: number; /** The amount of decimal places to truncate suffix-truncated numbers to (e.g. 1.23M vs 1.2312M)*/ decimalPrecisionForSuffix?: number; /** The largest suffix to use (e.g. if 1000000, we will stop at M and not use the B suffix) */ maxSuffixSize?: 1e3 | 1e6 | 1e9 | 1e12; numberFormatOptions?: Intl.NumberFormatOptions; /** Adds minimum significant digits value to force numbers to show decimal precision even when there are none 5 -> 5.00 */ minimumSignificantDigits?: number; } /** * Formats a number with conditional truncation, suffixation, and scientific notation. * @param number * @param options Customize the formatting conditions/behavior * @example Visualization, using default values: * ``` * <--(1.23E-7)---0.00001------(0.12121)-------1-------(123,423.26)---1,000,000---(1.22M)--(100.23M)--> * _______<-minBeforeScientific maxBeforeAggressive-> maxBeforeUseSuffix-> ^ w/ maxSuffixSize * ``` */ export declare function formatNumberAndStringify(number: number, options?: FormatNumberOptions, numberFormatOptions?: Intl.NumberFormatOptions): string; /** Formats a number for currency (default $) display */ export declare function formatCurrencyAndStringify(amount: number, /** Options to pass `formatNumberAndStringify */ options?: FormatNumberOptions, /** Options to pass toLocaleString */ numberFormatOptions?: Intl.NumberFormatOptions): string; export declare function formatPercent(percent: number, decimalPlaces?: number): string; /** * Formats a cryptocurrency amount as a string for display. * * Can customize with options and whether to display currency abbreviation. */ export declare function formatCryptoAndStringify( /** The currency amount **/ amount: number, /** The currency abbreviation e.g. ETH, USDC, ... **/ abbreviation?: string, /** Displays abbreviation after amount, e.g. '1.25 ETH'; default true **/ displayAbbreviation?: boolean, /** Used to format the number, can be used to customize decimal truncation etc. **/ options?: FormatNumberOptions): string; export declare function round(value: number, decimals: number, /** * Whether to round up ('ceil'), down ('floor'), or nearest ('round') * * Defauls to 'round' **/ method?: 'ceil' | 'floor' | 'round'): number; export {}; //# sourceMappingURL=formatNumber.d.ts.map