Module:Roman Numeral: Difference between revisions

Jump to navigation Jump to search
no edit summary
(Created page with "local function split(source, sep) local result = { [1] = '', [2] = '', [3] = '' } local count = 1 for c in source:gmatch('.') do if (c == sep) then count = count + 1 end if (result[count] == nil or result[count] == '') then result[count] = c else result[count] = result[count] .. c end if (c == sep) then count = count + 1 end end return result end l...")
 
No edit summary
Line 122: Line 122:
     local num = tonumber(args[1])
     local num = tonumber(args[1])
     if not num or num < 0 or num == math.huge then
     if not num or num < 0 or num == math.huge then
     error('Invalid number ' .. args[1], 2)
     return {'',''}
     elseif num == 0 then
     elseif num == 0 then
         return 'N'
         return {'N','0 is represented by N'}
     end
     end


Line 224: Line 224:
         end
         end
     end
     end
     return {roman, explanation}
     if args.explanation == "false" then
        return {roman}
    else
        return {roman, explanation}
    end


end
end

Navigation menu