lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> The only thing I found that appears to be missing is the ability to   
> determine the actual type of the number.                              

One shouldn't need to do this but you can do it as follows:

function isinteger(x)
	return tonumber(tostring(x),10)~=nil
end

> It would be nice if there was a method to do so in Lua itself.  One use 
> case is for serializing integer values to disk in text form properly.

tostring does this already.