Easy conversion from number to text (Spanish).
Project Description
Examples
# Python 2
from random import randint
from num2es import TextNumber
while True:
n = TextNumber(randint(0, 999999999999))
print (n.number)
print (n.nice_repr())
print unicode(n)
raw_input()
# Python 3
from random import randint
from num2es import TextNumber
while True:
n = TextNumber(randint(0, 999999999999))
print (n.number)
print (n.nice_repr())
print (n)
input()
Output:
464315924
464.315.924
cuatrocientos sesenta y cuatro millones trescientos quince mil novecientos
veinticuatro
411738837
411.738.837
cuatrocientos once millones setecientos treinta y ocho mil ochocientos treinta
y siete
244850467
244.850.467
doscientos cuarenta y cuatro millones ochocientos cincuenta mil cuatrocientos
sesenta y siete
# Python 2
from random import randint
from num2es import TextNumber
while True:
n = TextNumber(randint(0, 999999999999))
print (n.number)
print (n.nice_repr())
print unicode(n)
raw_input()
# Python 3
from random import randint
from num2es import TextNumber
while True:
n = TextNumber(randint(0, 999999999999))
print (n.number)
print (n.nice_repr())
print (n)
input()
Output:
464315924
464.315.924
cuatrocientos sesenta y cuatro millones trescientos quince mil novecientos
veinticuatro
411738837
411.738.837
cuatrocientos once millones setecientos treinta y ocho mil ochocientos treinta
y siete
244850467
244.850.467
doscientos cuarenta y cuatro millones ochocientos cincuenta mil cuatrocientos
sesenta y siete
Release history Release notifications
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size & hash SHA256 hash help | File type | Python version | Upload date |
---|---|---|---|
num2es-1.0.0a1-py2-none-any.whl (4.8 kB) Copy SHA256 hash SHA256 | Wheel | 2.7 | Dec 17, 2014 |
num2es-1.0.0a1-py2.zip (5.5 kB) Copy SHA256 hash SHA256 | Source | None | Dec 17, 2014 |
num2es-1.0.0a1-py3-none-any.whl (4.6 kB) Copy SHA256 hash SHA256 | Wheel | 3.4 | Dec 22, 2014 |
num2es-1.0.0a1-py3.zip (5.3 kB) Copy SHA256 hash SHA256 | Source | None | Dec 22, 2014 |