7816_error - fix number to hex conversion (thanks @vortix)
This commit is contained in:
1 parent
2323ff7f57
commit
bd7f1c6bfb
1 file changed
+2
-1
@@ -71,7 +71,8 @@ _errorcodes.tostring = function(command)
|
|||||||
return ("%s (%s)"):format(_reverse_lookup[command] or "ERROR UNDEFINED!", command)
|
return ("%s (%s)"):format(_reverse_lookup[command] or "ERROR UNDEFINED!", command)
|
||||||
end
|
end
|
||||||
if(type(command) == 'number') then
|
if(type(command) == 'number') then
|
||||||
return ("%s (%d)"):format(_reverse_lookup[ tostring(command)] or "ERROR UNDEFINED!", command)
|
local hx = ("%04X"):format(command)
|
||||||
|
return ("%s (0x%s)"):format(_reverse_lookup[hx] or "ERROR UNDEFINED!", hx)
|
||||||
end
|
end
|
||||||
return ("Error, numeric or string argument expected, got : %s"):format(tostring(command))
|
return ("Error, numeric or string argument expected, got : %s"):format(tostring(command))
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in new issue
Block a user