export interface NumberI18N { parse: (value: string) => number | undefined; format: (number?: string | number | null, decimalPlaces?: number, exact?: boolean) => string; unformat: (value: string) => string | undefined; thousandSeparator: string; decimalSeparator: string; thousandRE: RegExp; decimalRE: RegExp; } /** * Get the number internationalization object for a given language. * * @param language - The language to get the number internationalization object for (default: navigator.language). * @returns - The number internationalization object. */ export declare function getNumberI18N(language?: string): NumberI18N; /** * Round a number to a specified number of decimal places. * * @param num - The number to round. * @param digits - The number of decimal places to round to. * @returns - The rounded number. */ export declare function roundTo(num: number, digits: number): number; /** * Convert a string or number to a number, or return undefined if it is not a valid number. * * @param value - The string or number to convert. * @returns - The number, or undefined if it is not a valid number. */ export declare function asNumber(value: string | number | undefined | null): number | undefined; /** * Convert a string or number to a number, or return a default value if it is not a valid number. * * @param value - The string or number to convert. * @param alt - The default value to return if the conversion fails (default: 0). * @returns - The number, or the default value if it is not a valid number. */ export declare function toNumber(value: string | number | null | undefined, alt?: number): number; /** * Convert a string or number to a positive number, or return a default value if it is not a valid number. * * @param value - The string or number to convert. * @param alt - The default value to return if the conversion fails (default: 0). * @returns - The positive number, or the default value if it is not a valid number. */ export declare function toPositiveNumber(value: string | number | null | undefined, alt?: number): number; /** * Convert a numerator and denominator to a percentage. * * @param numerator - The numerator of the fraction. * @param denominator - The denominator of the fraction. * @returns - The percentage as a number. */ export declare function toPercentage(numerator: string | number | null | undefined, denominator: string | number): number; /** * Convert a percentage and total to a number. * * @param percent - The percentage to convert. * @param of - The total to calculate the percentage of. * @returns - The number equivalent of the percentage. */ export declare function fromPercentage(percent: string | number, of: string | number): number; /** * Convert a number to a string with a fixed number of decimal places. * * @param value - The number to convert. * @param places - The number of decimal places to include. * @param alt - The value to return if the conversion fails or value is null/undefined (default: 0). * @returns - The number as a string with the specified number of decimal places. */ export declare function toFixedNumber(value: string | number | null | undefined, places: number, alt?: number): string | undefined; /** * Remove trailing zeros from a number. * * @param value - The number to remove trailing zeros from. * @returns - The number as a string without trailing zeros. */ export declare function removeZeroDecimals(value: string): string; /** * Count the number of decimal places in a number. * * @param value - The number to count the decimal places of. * @returns - The number of decimal places. */ export declare function countDecimals(value: number): number;