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

Need help with using Soros #91

Closed grgaDo closed 2 years ago

grgaDo commented 2 years ago

Hello,

I am trying to transform numbers to words but I do not understand how I can use your solution. I mean... I have downloaded libnumbertext zip, discovered that there is Soros.py module and I think I need to use that program in order to transform numbers to words but I have no idea how. How can I call Soros.py and give it a number and a language and get a string containing the word representation?

Can you please help?!

grgaDo commented 2 years ago

Solved

After debugging .js from: https://numbertext.github.io/Soros.html, I found the solution. All you need to do is:

  1. find Soros.py
  2. find .sor file for your language
  3. write program that goes like this:
    
    import Soros

file = open('') program = file.read() file.close()

mySoros = Soros.compile(program, '') mySoros.run('')

Or if you want you can do all that with calling: Soros.compile(program, '', '')



And that's it. 
Hope this helps someone.