import { BigNumber } from 'bignumber.js'; export declare const formatBalance: (originAmount: BigNumber | string | number, showDecimals: number, autoUnit?: boolean) => string; type Props = { input: BigNumber | number | string | undefined; showDecimals?: number; showIntegerOnly?: boolean; showDecimalsOnly?: boolean; showPrecisionDecimals?: number; /** 超过多少位之后才使用科学计数法,默认8位小数,某些地方需要显示全部小数,可以传入18 */ exponentialDecimalsAmount?: number; noGroupSeparator?: boolean; /** dp 的第二位参数,决定多少位舍去小数. 不传则为 1 */ roundingMode?: BigNumber.RoundingMode; }; /** * format to readable number, like: 0.00 -> 0, 1.00 -> 1, 1.235 -> 1.23, 1.230 -> 1.23 * @param input */ export declare function formatReadableNumber({ input, showDecimals, showPrecisionDecimals, exponentialDecimalsAmount, showIntegerOnly, showDecimalsOnly, noGroupSeparator, roundingMode, }: Props): string; /** * format to percentage number * @param param0 input number */ export declare function formatPercentageNumber({ input, showDecimals, /** 这里百分比默认用四舍五入 */ roundingMode, }: { input?: BigNumber | string | number | null; showDecimals?: number; roundingMode?: BigNumber.RoundingMode; }): string; export declare function formatTokenAmountNumber({ input, decimals, showPrecisionDecimals, exponentialDecimalsAmount, noGroupSeparator, }: { input?: BigNumber | number | string | null; decimals?: number; } & Pick): string; /** * format to short number, like: -0.12 -> 0, 0.0000123->0.000012, 123.234 -> 123.23, 1234.12 -> 1.23K, 1000000.123->1.00M * @param n */ export declare function formatShortNumber(n?: BigNumber, showDecimals?: number): string; /** * 小于一千 两位小数,大于等于一千四位小数 * @param n */ export declare function formatShortNumberV2(n?: BigNumber): string; /** * 格式化大数字 */ export declare function formatBigNumber({ input, showDecimals, useFormatShortNumberV2, }: { input?: BigNumber | number | string | null; showDecimals?: number; useFormatShortNumberV2?: boolean; }): string; /** * 超过 billion 的数字使用科学计数法 * 19971400000000=1.99714×10^13 */ export declare function formatExponentialNotation(n?: BigNumber): string; export declare const toWei: (amount: BigNumber | string | number, decimals: number, notDp?: boolean) => BigNumber; export declare const byWei: (amount: BigNumber | string | number, decimals: number) => BigNumber; export declare const fixedString: (raw: string | number | BigNumber, showDecimals?: number) => string; /** * * @param input * @param limit * @returns * @deprecated 该方法可能会返回 0.000000 的结果,尽量使用 formatTokenAmountNumber 替代 */ export declare function clampDecimal(input: string, limit: number): string; export declare const fixedInputStringToFormattedNumber: (inputValue: string, inputTokenShowDecimals: number) => string | null; export declare const formatApy: (amount: BigNumber, showDecimals?: number, notPercent?: boolean, zipMinNumber?: number) => string; export {}; //# sourceMappingURL=formatter.d.ts.map