-- 此方法只转换数字没有单位
functionnumberToString(digit)---阿拉伯数字转大写
local wordDigit =""--得到的大写数字
local digitLength =0--阿拉伯数字长度
local iNum =0
local wordFigureList ={"零","壹","贰","叁","肆","伍","陆","柒","捌","玖"}if nil ==tonumber(digit) then
returntostring(digit)
end
digitLength =string.len(digit)if digitLength ==0 or tonumber(digit)<0 then
returntostring(digit)
end
for i =1, digitLength do
iNum = string.sub(digit,i,i)
wordDigit = wordDigit..wordFigureList[iNum +1]--转换为相应的数字
end
return wordDigit
end