UNPKG

number2chinesenumber

Version:

number to chinese number(阿拉伯数字转中文数字,支持大小写)

17 lines (16 loc) 822 B
/** * @description 数字转换模式,默认中文小写数字 * (amount => 中文小写金额 | max => 中文大写数字 | maxAmount => 中文大写数字金额) */ export type modeType = 'default' | 'amount' | 'max' | 'maxAmount'; export declare const decimalToChineseNumber: (digit: number, mode?: modeType) => string; export declare const ltTenThousand: (digit: number, mode?: modeType) => string; /** * 阿拉伯数字转中文数字 * @param digit 1-16位数字(长度不包含符号与小数部分,只保留三位小数) * @param mode 默认中文小写数字 * (amount => 中文小写金额 | max => 中文大写数字 | maxAmount => 中文大写数字金额) * @returns */ declare const number2chinesenumber: (digit: number | string, mode?: modeType) => string; export default number2chinesenumber;