Numbertext / libnumbertext

Number to number name and money text conversion libraries in C++, Java, JavaScript and Python & LibreOffice Calc Extension
BSD 3-Clause "New" or "Revised" License
67 stars 46 forks source link

Optimization when converting numbers #115

Open Codain opened 1 year ago

Codain commented 1 year ago

In both French and English, the following pull request is reducing by around 20% the time needed to convert numbers. This number has been computed when comparing conversion time for a large set of numbers (10000). The trick is to not use regexes when not required. There is also potentially an improvement when loading the SOR file but I did not measure since it is not something expected to be done often.

Also, the declaration of a method was not consistent, it has been fixed.

Thanks for your review.

Codain commented 2 months ago

@laszlonemeth , any chance you could have a look at this pull request?