npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

parse-chinese-number

v1.0.5

Published

quickly create a simple typescript project first

Readme

Parse Chinese Number

A simple but powerful module converting Chinese numeral into number and vice versa.

import { parseChineseNumber } from "parse-chinese-number";

parseChineseNumber("七點二一"); // 7.21
parseChineseNumber("點三"); // 0.3
parseChineseNumber("負六"); // -6
parseChineseNumber("萬五"); // 15000
parseChineseNumber("三億五千萬"); // 350000000
import { toChineseNumber } from "parse-chinese-number";

toChineseNumber(1234); // "一千二百三十四"
toChineseNumber(-654321.1234); // "負六十五萬四千三百二十一點一二三四"
toChineseNumber(2300450607800); // "二兆三千零四億五千零六十萬七千八百"

Demo

Please visit https://tommyinb.github.io/parse-chinese-number/

Variants

Chinese variants are supported. For example, "一" and "壹" are inter-changeable.

parseChineseNumber("兩万參仟肆佰伍十陸"); // 23456
parseChineseNumber("拾四亿"); // 14_0000_0000
toChineseNumber(150000000, Style.Big, Script.Traditional); // "壹億伍仟萬"
toChineseNumber(150000000, Style.Big, Script.Simplified); // "壹亿伍仟万"
toChineseNumber(150000000, Style.Small, Script.Traditional); // "一億五千萬"
toChineseNumber(150000000, Style.Small, Script.Simplified); // "一亿五千万"

| Character | Variants | | --------- | ------------------------- | | 一 | 壹, 乙, 1, 1 | | 二 | 貳, 貮, 贰, 兩, 两, 2, 2 | | 三 | 參, 叁, 参, 叄, 3, 3 | | 四 | 肆, 4, 4 | | 五 | 伍, 5, 5 | | 六 | 陸, 陆, 6, 6 | | 七 | 柒, 7, 7 | | 八 | 捌, 8, 8 | | 九 | 玖, 9, 9 | | 零 | 〇, 0, 0 | | 十 | 拾 | | 百 | 佰 | | 千 | 仟 | | 萬 | 万 | | 億 | 亿 |

Big Number

The biggest unit is which represents 1_0000_0000_0000_0000_0000.

Please be noted that this unit is a lot larger than MAX_SAFE_INTEGER, 9007_1992_5474_0991.

| Unit | Value | | ---- | --------------------------- | | 萬 | 10,000 | | 億 | 100,000,000 | | 兆 | 1,000,000,000,000 | | 京 | 10,000,000,000,000,000 | | 垓 | 100,000,000,000,000,000,000 |

In fact, value starting from should be considered imprecise.