number-reads-cn
Version:
数字中文读法转换工具(电话读法、数值读法、序列读法、金额读法、大写读法)
30 lines (21 loc) • 765 B
Markdown
# number-reads-cn
将数字字符串转成中文读法:电话读法、数值读法、序列读法、金额读法、大写读法。
## 安装
```bash
npm install number-reads-cn
```
## 使用
```ts
import { getAllNumberReads } from 'number-reads-cn'
console.log(getAllNumberReads('18088888888'))
```
## 输出结果
```ts
[
{ label: '电话读法', value: '一八零 八八八八 八八八八' },
{ label: '数值读法', value: '一百八十亿八千八百八十八万八千八百八十八' },
{ label: '序列读法', value: '一八零八八八八八八八八' },
{ label: '金额读法', value: '一百八十亿八千八百八十八万八千八百八十八元' },
{ label: '大写读法', value: '壹捌零捌捌捌捌捌捌捌捌' },
]
```