How do pythonistas print a number as words, like the equivalent of the Common Lisp code:
[3]> (format t \"~r\" 1e25)
nine septillion, nine hundred and nin
-
I just started a work in Turkish, it may be helpful.
https://github.com/guneysus/humanizer-tr
It return a list of strings, and comes with easy testing functions randomizer()
prettizer()
and the core function humanizer()
It may handle very large numbers because it did not use dividing approach, but uses string segmentation and manipulation.
You can enter even number or string.
Since i did not write a number verification it can even handle a non number text
:)
>>> humanizer('STACK OVER FLOW')
['STA Trilyon', 'CK Milyar', 'OVE Milyon', 'R F Bin', 'LOW']
- 热议问题