/** * Number Formatting Utilities * * 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 * * Simple rule: the last occurring . or , is the decimal separator. * Everything else is stripped. This works for both US (1,234.56) and * European (1.234,56) input, and for mobile keyboards that use , as decimal. * One grouping exception: a repeated separator ("1.234.567") can't be a * decimal point, so it's stripped as thousands grouping. A LONE separator is * always decimal — "$1,234" pasted from formatted text parses as 1.234; this * known ambiguity is resolved in favor of typed input ("12,50" → 12.5). * * @example * ```typescript * parseNumericValue("1,234.56") // 1234.56 (last separator is .) * parseNumericValue("1.234,56") // 1234.56 (last separator is ,) * parseNumericValue("12,50") // 12.5 (last separator is ,) * parseNumericValue("12.50") // 12.5 (last separator is .) * parseNumericValue("1234") // 1234 * parseNumericValue("1.234.567") // 1234567 (repeated separator = grouping) * parseNumericValue("$1,234") // 1.234 (lone separator = decimal; known paste ambiguity) * parseNumericValue("15%") // 15 * parseNumericValue("") // 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;