请输入您要查询的百科知识:

 

词条 Module:ConvertNumericPerMOS
释义

local p = {}

function p.main(frame)

local numeral = tonumber(frame.args[1])

local forcenum = frame.args['forcenum'] -- Force numeral for intermediate cases

local spell = 0

if numeral<0 or math.fmod(numeral,1)~=0 then

elseif numeral<10 then

spell = 1

elseif numeral>=10 then

if frame:expandTemplate{ title = 'yesno', args = {forcenum} } ~= 'yes' then

local spelled = frame:expandTemplate{title='spellnum',args={numeral}}

if not mw.ustring.find(spelled,'%a+[ %-]%a+[ %-]%a+') then

spell = 1

end

end

end

local number

if spell==1 then

number = frame:expandTemplate{ title = 'spellnum', args = { numeral, zero = frame.args['zero'], adj = frame.args['adj'], ord = frame.args['ord'], us = frame.args['us'] } }

else

number = numeral

end

return number

end

return p

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/9/22 11:27:03