pycnnum API documentation

# pycnnum

Chinese number <=> int/float conversion for Python3.8+

Example:

    >>> from pycnnum import cn2num, num2cn
    >>> cn2num("一百二十三")
    123
    >>> num2cn(123)
    '一百二十三'
    >>> cn2num("一兆零四十五", numbering_type="mid")
    1000000000045

- `pycnnum.pycnnum.cn2num`
- `pycnnum.pycnnum.num2cn`

View Source

     1"""Chinese number <=> int/float conversion for Python3.8+
     2
     3Example:
     4
     5```python
     6
     7>>> from pycnnum import cn2num, num2cn
     8>>> cn2num("一百二十三")
     9123
    10>>> num2cn(123)
    11'一百二十三'
    12>>> cn2num("一兆零四十五", numbering_type="mid")
    131000000000045
    14
    15```
    16
    17- `.pycnnum.cn2num`
    18- `.pycnnum.num2cn`
    19"""
    20
    21from .__version__ import __version__
    22from .pycnnum import cn2num, num2cn