/** * 货币格式化 - 基于 Intl.NumberFormat * * 禁止使用 toFixed,禁止硬编码货币符号 * 必须接收 currency 参数,由调用方决定币种 */ export interface FormatCurrencyOptions { /** ISO 4217 货币代码,如 'USD', 'CNY', 'EUR' */ currency: string; /** BCP 47 语言标签,默认从浏览器读取 */ locale?: string; /** 小数位数(可选,默认由币种决定) */ minimumFractionDigits?: number; maximumFractionDigits?: number; } /** * 格式化货币金额 * * @param amount - 金额数值 * @param optionsOrCurrency - 格式化选项对象,或直接传 ISO 4217 货币代码字符串 * @returns 格式化后的货币字符串 * * @example * ```typescript * formatCurrency(1234.5, { currency: 'USD' }); * // => "$1,234.50" * * formatCurrency(1234.5, 'CNY'); * // => "¥1,234.50" * ``` */ export declare function formatCurrency(amount: number, optionsOrCurrency: FormatCurrencyOptions | string): string; //# sourceMappingURL=currency.d.ts.map