UNPKG

sigfig

Version:

Round a number to n significant figures.

11 lines (10 loc) 528 B
export declare function convertNumberToString(numberOrString: number | string): string; /** Returns a normalized representation of the number, which includes: - Leading zeros excluded - Always a decimal point. If the number is a whole number, the decimal point is at the end of the number (1234.) If the absolute value of the number is less than 1, then the leading zero is omitted (.1234) */ export declare function normalizeNumberString(numberString: string): { isNegative: boolean; normalizedNumberString: string; };