The documentation says tonum(val) returns nil if the conversion fails, but it actually returns nothing. Tested in 0.1.11d.
P#46938 2017-12-02 13:03 ( Edited 2017-12-03 03:36)
r is set to nil even when the function does not return anything. Instead, try the following:
print(type(nil)) print(type(tonum("sdfds"))) |
P#46943 2017-12-02 14:35 ( Edited 2017-12-02 19:35)
[Please log in to post a comment]