将阿拉伯数字转换为语文汉字数字

 

local function NumToCN(num)
    local size = #tostring(num)
    local CN = ""
    local StrCN = {"","","","","","","","",""}
    for i = 1 , size do
        CN = CN .. StrCN[tonumber(string.sub(tostring(num), i , i))]
    end
    return CN
end
print(NumToCN(56665))

 

posted @ 2018-11-22 11:12  anobscureretreat  阅读(1064)  评论(0编辑  收藏  举报