/** * Number Formatting Utilities * PORTED FROM: clj/ty/i18n/number.cljs * * Uses native Intl.NumberFormat for locale-aware number formatting * Supports currency, percent, compact notation, and custom precision */ export type NumberFormatType = 'number' | 'currency' | 'percent' | 'compact'; export interface FormatConfig { type: NumberFormatType; locale?: string; currency?: string; precision?: number; } /** * Format a number based on configuration * * @example * ```typescript * formatNumber(1234.56, { type: 'currency', currency: 'USD', locale: 'en-US' }) * // Returns: "$1,234.56" * * formatNumber(0.15, { type: 'percent', precision: 2 }) * // Returns: "15.00%" * * formatNumber(1234567, { type: 'compact' }) * // Returns: "1.2M" * ``` */ export declare function formatNumber(value: number, config: FormatConfig): string; /** * Parse a numeric string to a number * Handles various formats and returns null if invalid * * @example * ```typescript * parseNumericValue("1,234.56") // Returns: 1234.56 * parseNumericValue("$1,234.56") // Returns: 1234.56 * parseNumericValue("15%") // Returns: 15 * parseNumericValue("abc") // Returns: null * parseNumericValue("") // Returns: null * ``` */ export declare function parseNumericValue(value: string): number | null; /** * Check if input type requires numeric formatting * * @example * ```typescript * shouldFormat('currency') // true * shouldFormat('percent') // true * shouldFormat('text') // false * ``` */ export declare function shouldFormat(type: string): boolean; /** * Format currency with locale * Convenience function for currency formatting */ export declare function formatCurrency(value: number, currency?: string, locale?: string): string; /** * Format percent with locale * Convenience function for percent formatting * * Note: Expects value as 0.15 for 15% */ export declare function formatPercent(value: number, locale?: string, precision?: number): string; /** * Format compact notation * Convenience function for compact formatting * * @example * formatCompact(1234567) // "1.2M" * formatCompact(1234) // "1.2K" */ export declare function formatCompact(value: number, locale?: string): string; //# sourceMappingURL=number-format.d.ts.map