阿拉伯数字转中国数字 支持转换范围 0~99 输入:num = “10” 输出:’十’ 输入:num = “15” 输出:’十五’ 12345678910111213141516const transformNum = (num) => { const chars = (num + '').split('') const capitalNum = '零一二三四五六七八九十' if (num <= 10) { return capitalNum[num] || num } let split = '' if (num >= 10 && num < 100 && (num % 10 !== 0)) { split = '十' } const str = chars.map(char => { if (char == 0) char = 10 return capitalNum[char] || '' }).join(split) return num < 20 ? str.slice(-2) : str}