django-vue3-admin-web/node_modules/xe-utils/commafy.d.ts
2025-10-20 21:21:14 +08:00

42 lines
852 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

export interface CommafyOptions {
/**
* 分割位数默认3
*/
spaceNumber?: number;
/**
* 分隔符,默认','
*/
separator?: string;
/**
* 只对 number 类型有效,小数位数,默认null
*/
digits?: number;
/**
* 只对 number 类型有效四舍五入默认true
*/
round?: boolean;
/**
* 只对 number 类型有效,向上舍入
*/
ceil?: boolean;
/**
* 只对 number 类型有效,向下舍入
*/
floor?: boolean;
}
/**
* 数值千分位分隔符、小数点
* @param num 数值/字符串
* @param options 可选参数
*/
export declare function commafy(num: string | number, options?: CommafyOptions): string;
declare module './ctor' {
interface XEUtilsMethods {
commafy: typeof commafy;
}
}
export default commafy