davedelong / DDMathParser

String → Number
MIT License
854 stars 153 forks source link

.2 is now an error, used to work in Objective C version #144

Closed horaceho closed 6 years ago

horaceho commented 6 years ago

The Swift version gives an error for .2, i.e. decimal number without a leading zero. 0.2 is OK. How can I config MathParse to make leading zero as optional in a decimal number?

horaceho commented 6 years ago

It's because matchesPreconditions of NumberExtractor does not accept leading dot . as legal.

Updated: Wow! You've updated it. Thanks!