Module:Kangxi radical
Appearance
require('strict')
local p = {}
function p.Kxr(frame)
-- simplify handling of args
local getArgs = require('Module:Arguments').getArgs
local args = getArgs(frame)
if args[2] then
error("Only one argument of a number between 1 and 214 is accepted")
elseif type(args[1]) ~= "number" or args[1] < 1 or args[1] > 214 then
error("Argument must be a number between 1 and 214")
else
return p._Kxr(args)
end
return
end
function p._Kxr(args)
local unicode = math.floor(args[1]) + 0x2F00 - 1
local u_str = "&#" .. unicode .. ";"
local result = u_str
return result
end
return p