kh-tool
Version:
12 lines (11 loc) • 390 B
TypeScript
/**
* 主要用于格式化数字
* eg: 1234567 => 1,234,567
*/
export declare function FormatNumber(str: string): string;
/**
* 将数字每3位之间用逗号分割,例如12345.22格式化为 12,345.22
* @param {String} s 要格式化的数值
* @param {Number} n 保留小数的位数
*/
export declare function FormatNumber2Decimal(s: string, n?: number): string;