/** * Numeric-string helpers for AutoFill detectors. * * Centralizes the two subtle numeric concerns detectors share: recognizing a * *canonical* numeric string (so `"001"` is left to the text-number detector), * and formatting an integer back to a fixed width to preserve leading zeros. * * @packageDocumentation */ /** Relative tolerance for treating floating-point diffs as equal. */ export declare const FLOAT_EPSILON = 1e-9; /** * Parses a value to a finite number when it is a JS number or a *canonical* * numeric string (one that round-trips through `Number` → `String`). Canonical * matching deliberately rejects leading-zero forms like `"001"` and thousands * separators, leaving those to the text-number detector. * * @param value - The source value. * @returns The finite number, or `null` when not canonically numeric. */ export declare function parseCanonicalNumber(value: unknown): number | null; /** * Counts the decimal places in a numeric value's canonical string form, used to * round extrapolated values and avoid floating-point drift (`0.1 + 0.2`). * * @param value - A finite number. * @returns The number of fractional digits (`0` for integers). */ export declare function decimalPlaces(value: number): number; /** * Rounds a number to a fixed number of decimal places, returning a clean value * free of binary floating-point noise. * * @param value - The value to round. * @param decimals - Fractional digits to keep (`0`–`15`). * @returns The rounded number. */ export declare function roundTo(value: number, decimals: number): number; /** * Formats a non-negative integer to at least `width` digits, left-padding with * zeros. Values that need more digits than `width` are emitted in full (natural * widening, e.g. `099 → 100`). * * @param value - The integer magnitude to format (already sign-stripped). * @param width - Minimum digit count. * @returns The zero-padded string. */ export declare function padInteger(value: number, width: number): string; //# sourceMappingURL=number-format.d.ts.map