You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
774 B

4 months ago
/**
* x位小数
*/
export declare function toPrecision(num: number, precision: number): number;
/**
*
* 100000 -> 10,000
*/
export declare function toThousands(num: number): string;
/**
*
* 1000000 = 1e6
*/
export declare function toScientificNotation(num: number): string;
/**
* k的方式表达
* 1234 -> 1K
* 12345 -> 12K
*/
export declare function toKNotation(num: number, precision?: number): string;
export declare const ifNegative: <T extends keyof any>(x: any, a: T, b?: T) => T | undefined;
export declare const ifPositive: <T extends keyof any>(x: any, a: T, b?: T) => T | undefined;
export declare const multi: (a: number, b: number) => number;
export declare const mid: (a: number, b?: number) => number;