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

Would be nice to have clever and configurable rounding, and also output using "technobabble" multipliers (kilo, meg, gig) #92

Open tml1024 opened 2 years ago

tml1024 commented 2 years ago

It would be nice if the library could also be used for conversion to an approximate reading of a number. As in:

970,123,456 => "one gig" 929,456,789 => "nine hundred meg" 1,210,789,123 => "one point two gig"

How exactly to do such rounded conversion would need to be configurable, using some high-level settings with meanings like "at most two digits", "use 'meg' instead of 'million'" etc. With other parameters, the numbers above would instead turn into:

970,123,456 => "nine hundred and seventy million" 929,456,789 => "nine hundred and thirty million" 1,210,789,123 => "one point two one billion"