Module:Convert to eastern arabic numerals: Difference between revisions

Content deleted Content added
No edit summary
m Comma "," (U+002C) → Arabic Decimal Separator "٫" (U+066B)
 
(6 intermediate revisions by one other user not shown)
Line 12:
['8'] = '٨',
['9'] = '٩',
['%.'] = ',٫'
}
 
function p.convert_str_convert(num_strargs)
if args == nil then
for western, eastern in pairs(conversion_table) do
return 'Error! Arguments provided are null'
num_str = string.gsub(num_str, western, eastern)
end
if args[1] == nil then
return num_str
return nil ''
end
local num_str = tostring(frame.args[1])
local new_str, _ = string.gsub(num_str, '[0-9.]', conversion_table)
return num_strnew_str
end
 
function p.convert(frame)
ifreturn p._convert(frame.args == nil then )
return nil
end
local num_str = tostring(frame.args[1])
return p.convert_str(num_str)
end