lua-users home
lua-l archive

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


On Mon, Apr 27, 2009 at 09:32:03AM -0400, Mike Crowe wrote:
>    if tonumber(something) > 0 then

I think an elegant solution is:

  if (tonumber(something) or 0)  >  0 then

This both chooses and shows the numeral representation of non-numbers.


-- 
Tommy Pettersson <ptp@lysator.liu.se>