# chinese-parseint2

> parse Chinese numeric strings to integer

Latest version **2.0.12** (published 2026-09-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install chinese-parseint2
pnpm add chinese-parseint2
yarn add chinese-parseint2
bun add chinese-parseint2
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.0.12 |
| Published | 2026-09-11 |
| First published | 2020-06-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 66.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 26 |
| Author | kong0107 |
| Maintainers | bluelovers |
| Keywords | chinese, parseInt, integer, create-by-yarn-tool, create-by-tsdx |

## Links

- npm: https://www.npmjs.com/package/chinese-parseint2
- Repository: https://github.com/bluelovers/ws-string
- Homepage: https://github.com/bluelovers/ws-string/tree/master/packages/chinese-parseint2#readme
- Issues: https://github.com/bluelovers/ws-string/issues
- npm.io page: https://npm.io/package/chinese-parseint2

## Recent versions

- 2.0.12 (latest) — 2026-09-11
- 2.0.11 — 2026-09-11
- 2.0.10 — 2026-09-11
- 2.0.6 — 2023-09-08
- 2.0.5 — 2023-04-12
- 2.0.3 — 2022-11-01
- 2.0.2 — 2022-10-15
- 2.0.1 — 2022-09-16
- 1.1.10 — 2022-08-27
- 1.1.7 — 2022-08-26
- 1.1.6 — 2022-08-26
- 1.1.5 — 2022-01-17
- 1.1.4 — 2021-07-05
- 1.1.3 — 2020-07-19
- 1.1.2 — 2020-06-21
- … 1 more at https://npm.io/package/chinese-parseint2/versions

## README

# chinese-parseint2

> Parse Chinese numeric strings to integer; also usable for client-side script.

## 安裝 (Installation)

```bash
# 使用 yarn / Using yarn
yarn add chinese-parseint2

# 使用 yarn-tool / Using yarn-tool
yarn-tool add chinese-parseint2
# yt 是 yarn-tool 的別名 / yt is an alias for yarn-tool
yt add chinese-parseint2

# 使用 pnpm / Using pnpm
pnpm add chinese-parseint2

# 使用 npm / Using npm
npm install chinese-parseint2
```

## In browsers (front-end JavaScript)
Download `chinese-parseint.js`.
### Usage
```html
<script src="chinese-parseint.js"></script>
<!-- `chinese_parseInt` would be defined. -->
<script>
    console.log(chinese_parseInt('六八九萬')); ///< display 6890000 in console.
</script>
```

## In Node.js
### Usage
```javascript
var chinese_parseInt = require('chinese-parseint');
chinese_parseInt('一千零一十'); ///< returns 1010
chinese_parseInt('二十四万二'); ///< returns 242000
```

## Notes
* This does NOT check if the string is semantically right in Chinese. For example, `chinese_parseInt('千三萬')` returns 10030000 instead of `NaN` even if '千三萬' is not a right term in Chinese.
* See `chinese_parseInt.characters` for corresponding numbers of each accepted Chinese character.
* To convert character encodings (such as from Big5 to UTF-8), consider [`iconv-lite`](https://www.npmjs.com/package/iconv-lite) package.

---
_Source: https://npm.io/package/chinese-parseint2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
