axiacore / py-expression-eval

MIT License
149 stars 54 forks source link

Support decimals beginning with only a dot #34

Closed flotwig closed 6 years ago

flotwig commented 6 years ago

This PR adds support for decimals like .01. Previously, the parser would crash at isNumber with a ValueError: cannot convert '.' to float. Now it understands this abbreviated way of specifying decimals.

Also added some tests for decimal numbers in varying expressions.

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at ?% when pulling a7ec30155c18e9f4ce1d5ec4341e1af82dafcb26 on flotwig:allow-abrupt-decimals into de41e02ff7eb7ece314cc59cc51b0c0990970416 on Axiacore:master.

camilonova commented 6 years ago

Thank you