【转载】jq 阿拉伯数字转换为汉字标题一、二、三

function convertToChinese(num) {
        let N = [
         "零", "一", "二", "三", "四", "五", "六", "七", "八", "九"
        ];
        let str = num.toString();
        let len = num.toString().length;
        let C_Num = [];
        for (let i = 0; i < len; i++) {
            C_Num.push(N[str.charAt(i)]);
        }
        return C_Num.join('');
    },

原文地址:https://blog.csdn.net/weixin_42779368/article/details/93468890

posted @ 2020-08-11 17:17  吃辣椒的小毛驴  阅读(544)  评论(0编辑  收藏  举报