'how to convert number names to numbers like one point ninety nine percent to 1.99% for nlp task

I am doing sentence comparison between actual text and speech to text. on this scenario I need to convert the number names one point ninety nine percent to 1.99%.

input : you will get discount of one point ninety nine percent.

output : you will get discount of 1.99%.

any suggestions or any libraries which will help to get rid of this situations. Thanks for your input.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source