https://github.com/justforuse/number-to-chinese
Convert number to chinese characters
https://github.com/justforuse/number-to-chinese
npm
Last synced: 21 days ago
JSON representation
Convert number to chinese characters
- Host: GitHub
- URL: https://github.com/justforuse/number-to-chinese
- Owner: justforuse
- Created: 2021-11-18T13:58:01.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-01-04T09:55:30.000Z (over 4 years ago)
- Last Synced: 2025-10-22T02:22:56.641Z (8 months ago)
- Topics: npm
- Language: TypeScript
- Homepage:
- Size: 77.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Number To Chinese
This is a js library that help you to transform number to chinese.
## Install
```
npm i @codog/number-to-chinese
```
It provide two useful functions: `numberToChinese` and `getChineseNumberList`
`numberToChinese` is transform single number.
```js
import { numberToChinese } from '@codog/number-to-chinese'
console.log(numberToChinese(1)) // Output: '一'
```
`getChineseNumberList` well provide a list of chinese number so you not need to iterate the `numberToChinese` function.
```js
import { getChineseNumberList } from '@codog/number-to-chinese'
console.log(getChineseNumberList(3)) // Output: ['一', '二', '三']
```