UNPKG

rmb-capital

Version:

阿拉伯数字金额转为汉字大写

50 lines (47 loc) 1.19 kB
interface RmbCapitalConverterConfig { /** * @default ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖',] */ capital_numbers: string[]; /** * @default ['', '拾', '佰', '仟'] */ integer_units: string[]; /** * @default ['', '万', '亿'] */ place_units: string[]; /** * @default ['角', '分', '厘', '毫'] */ decimal_units: string[]; /** * @default '人民币' */ prefix: string; } interface RmbCapitalConverterOptions extends Partial<RmbCapitalConverterConfig> { } /** * 转换 * @param amount * @param options * @returns */ declare function rmbCapital(amount: string | number, options?: RmbCapitalConverterOptions): string; /** * 转换整数部分 * * @param amount * @param options * @returns */ declare function convertInteger(amount: string | number, options?: RmbCapitalConverterOptions): string; /** * 转换小数部分 * @param amount * @param options * @returns */ declare function convertDecimal(amount: string | number, options?: RmbCapitalConverterOptions): string; export { convertDecimal, convertInteger, rmbCapital as default, rmbCapital };