forked from savoirfairelinux/num2words
-
Notifications
You must be signed in to change notification settings - Fork 1
CLI Reference
Jean-Louis Queguiner edited this page May 2, 2026
·
1 revision
The package installs a num2words2 command.
num2words2 [options] <number>num2words2 10001
# ten thousand and one
num2words2 24120.10
# twenty-four thousand, one hundred and twenty point one
num2words2 24120.10 --lang es
# veinticuatro mil ciento veinte punto uno
num2words2 2.14 --lang es --to currency
# dos euros con catorce céntimosThe command also supports module execution:
python -m num2words2 42 --lang fr| Option | Description |
|---|---|
<number> |
Number or string value to convert |
-l, --lang <code>
|
Output language. Default: en
|
--to <mode> |
Conversion mode. The legacy script entrypoint also accepts -t
|
--list-languages |
Print supported language and locale codes |
--list-converters |
Print supported conversion modes |
-h, --help
|
Show command help |
-v, --version
|
Show script version when using the legacy script entrypoint |
num2words2 --list-convertersCurrent modes:
cardinal
cheque
currency
fraction
ordinal
ordinal_num
year
- Quote shell-sensitive values such as fractions:
num2words2 '1/3'. - For locale codes with hyphens, quote only when your shell requires it:
num2words2 42 --lang pt-BR. - Use the Python API when you need keyword options such as
currency=,precision=,style=,gender=, orcase=.
Documentation for jqueguiner/num2words2. Licensed under LGPL-2.1.