UNPKG

1.31 kBTypeScriptView Raw
1/// <reference types="react" />
2export declare function toLocaleString(num: number, locale?: string): string;
3export declare function clampValue(value: number, min?: number, max?: number): number;
4export declare function getValueOrEmptyValue(value?: number | string): string;
5/** Transforms the localized number (ex. "10,99") to a javascript recognizable string number (ex. "10.99") */
6export declare function parseStringToStringNumber(value: number | string, locale: string | undefined): string;
7/** Returns `true` if the string represents a valid numeric value, like "1e6". */
8export declare function isValueNumeric(value: string, locale: string | undefined): boolean;
9export declare function isValidNumericKeyboardEvent(e: React.KeyboardEvent, locale: string | undefined): boolean;
10/**
11 * Round the value to have _up to_ the specified maximum precision.
12 *
13 * This differs from `toFixed(5)` in that trailing zeroes are not added on
14 * more precise values, resulting in shorter strings.
15 */
16export declare function toMaxPrecision(value: number, maxPrecision: number): number;
17/**
18 * Convert full-width (Japanese) numbers to ASCII, and strip all characters that are not valid floating-point numeric characters
19 */
20export declare function sanitizeNumericInput(value: string, locale: string | undefined): string;