gopher-lua icon indicating copy to clipboard operation
gopher-lua copied to clipboard

tonumber fails to convert float numbers without decimal point

Open meetmauro opened this issue 7 years ago • 3 comments

Tonumber does not convert float numbers like "3e6" and gives back nil. Proposed modification tries to convert to integer first and if failing to float.

meetmauro avatar May 25 '18 09:05 meetmauro

@meetmauro Thanks for your contribution, could you add a tests to _glua-tests/issues.lua ?

yuin avatar May 29 '18 13:05 yuin

Hi @yuin I tried adding the test to the issues.lua but that is in turn failing in other places when I run it with glua to test it... ./glua _glua-tests/issues.lua gives issues.lua line:174(column:18) near '(': ambiguous syntax (function call x new statement) not sure how to proceed... Is this the right way to run the lua tests?

meetmauro avatar Jun 07 '18 14:06 meetmauro

@meetmauro You can run tests by make test . See CONTRIBUTING.md

yuin avatar Jun 09 '18 04:06 yuin