实现代码
convertToChinese(number) { const chineseNumbers = ["一", "二", "三", "四", "五","六","七","八","九","十","十一","十二","十三","十四","十五","十六","十七","十八","十九","二十"]; const stringNumber = number.toString(); let chineseString = ""; for (let i = 0; i < stringNumber.length; i++) { const digit = parseInt(stringNumber[i]); chineseString += chineseNumbers[digit] || ""; } return chineseString; }