fix(lua): #989 依会计凭证书写要求,修正万亿的金额大写格式
This commit is contained in:
parent
0367c85243
commit
59f81a5a18
@ -133,11 +133,12 @@ local function number_translatorFunc(num)
|
||||
|
||||
local number2cnCharInt = number2cnChar(numberPart.int, 1)
|
||||
local number2cnCharDec = decimal_func(numberPart.dec, { [1] = "角", [2] = "分", [3] = "厘", [4] = "毫" }, { [0] = "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" })
|
||||
table.insert(result, { number2cnCharInt .. number2cnCharDec , "〔金额大写〕"})
|
||||
if string.len(numberPart.int) > 4 and number2cnCharInt:find('^' .. '拾万') then
|
||||
number2cnCharInt = number2cnCharInt:gsub('^' .. '拾万', '壹拾万')
|
||||
table.insert(result, { number2cnCharInt .. number2cnCharDec , "〔金额大写〕"})
|
||||
if string.len(numberPart.int) > 4 and number2cnCharInt:find('^拾[壹贰叁肆伍陆柒捌玖]?') and number2cnCharInt:find('[万亿]') then -- 简易地规避 utf8 匹配问题
|
||||
local number2cnCharInt_var = number2cnCharInt:gsub('^拾', '壹拾')
|
||||
table.insert(result, { number2cnCharInt_var .. number2cnCharDec , "〔金额大写〕"})
|
||||
-- 会计书写要求 https://github.com/iDvel/rime-ice/issues/989
|
||||
end
|
||||
-- table.insert(result, { number2cnCharInt .. number2cnCharDec , "〔金额大写〕"})
|
||||
return result
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user