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

chinese-number-format

v1.1.0

Published

中文數字轉換Chinese numeral conversion

Downloads

57

Readme

chinese-number-format

NPM version

A utility for converting between Chinese numerals and Arabic numbers, supporting both Traditional (zh-TW) and Simplified Chinese (zh-CN).

Features

  • Convert numbers to Chinese characters
  • Convert numbers to Chinese with units (up to 載/载)
  • Convert numbers to approximate Chinese with units
  • Convert Chinese characters to numbers
  • Convert to uppercase Chinese numerals
  • Support both Traditional Chinese (zh-TW) and Simplified Chinese (zh-CN)

Installation

npm install chinese-number-format

API Reference

Basic Conversion

import { toChinese } from 'chinese-number-format';

// Basic number to Chinese
toChinese(1234567890, 'zh-TW'); // => '一二三四五六七八九零'
toChinese(9876543210, 'zh-CN'); // => '九八七六五四三二一零'

Units Conversion

import { toChineseWithUnits } from 'chinese-number-format';

// Number to Chinese with units
toChineseWithUnits(1234567890, 'zh-TW'); // => '一十二億三千四百五十六萬七千八百九十'
toChineseWithUnits(123.45, 'zh-CN'); // => '一百二十三点四五'

Approximate Numbers

import { toChineseApproximate } from 'chinese-number-format';

// Convert to approximate values
toChineseApproximate(12345); // => '一點二萬'
toChineseApproximate(1234567890, { locale: 'zh-CN' }); // => '十二点三亿'
toChineseApproximate(12345, { precision: 2 }); // => '一點二三萬'

Chinese to Number

import { toNumber } from 'chinese-number-format';

// Chinese to number
toNumber('一二三四五六七八九零'); // => 1234567890
toNumber('一二三點四五'); // => 123.45

Uppercase Conversion

import { toUpperCase } from 'chinese-number-format';

// Convert to uppercase Chinese numerals
toUpperCase('一二三', 'zh-TW'); // => '壹貳參'
toUpperCase('123', 'zh-CN'); // => '壹贰叁'

Month Conversion

import { toChineseMonth } from 'chinese-number-format';

// Convert to Chinese month
toChineseMonth(1); // => '一月'
toChineseMonth(1, { format: 'traditional' }); // => '正月'
toChineseMonth(12, { locale: 'zh-CN', format: 'traditional' }); // => '腊月'

API Details

toChinese(number, locale?)

  • number: Number to convert
  • locale: 'zh-TW' | 'zh-CN' (Default: 'zh-TW')
  • Returns: String

toChineseWithUnits(number, locale?)

  • number: Number to convert
  • locale: 'zh-TW' | 'zh-CN' (Default: 'zh-TW')
  • Returns: String

toChineseApproximate(number, options?)

  • number: Number to convert
  • options:
    • locale: 'zh-TW' | 'zh-CN' (Default: 'zh-TW')
    • precision: number (Default: 1)
  • Returns: String

toNumber(chinese)

  • chinese: Chinese numeral string
  • Returns: Number

toUpperCase(input, locale?)

  • input: String to convert
  • locale: 'zh-TW' | 'zh-CN' (Default: 'zh-TW')
  • Returns: String

toChineseMonth(month, options?)

  • month: Number (1-12)
  • options:
    • locale: 'zh-TW' | 'zh-CN' (Default: 'zh-TW')
    • format: 'traditional' | 'simple' (Default: 'simple')
  • Returns: String

Notes

  • Default locale is zh-TW (Traditional Chinese)
  • Maximum supported unit for toChineseWithUnits is 載/载 (10^44)
  • toNumber does not support conversion of numbers with units
  • toChineseApproximate supports automatic unit selection for large numbers