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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@siakhooi/number-to-chinese-words

v1.12.4

Published

Library to translate number into chinese words

Downloads

35

Readme

number-to-chinese-words

  • npm package to translate number to chinese words

License Code Style GitHub last commit GitHub tag (latest by date) GitHub issues GitHub closed issues GitHub pull requests GitHub closed pull requests GitHub top language

Release npm npm npm type definitions

Quality-CodeClimate Maintainability Code Climate maintainability Code Climate issues Code Climate technical debt Test Coverage

Quality-Sonar Code Smells Duplicated Lines (%) Bugs Vulnerabilities Technical Debt Maintainability Rating Security Rating Reliability Rating Quality Gate Status

Generic badge Generic badge count

Features

  • Translate numbers into Chinese characters for:
    • Integer -9007,1992,5474,0991 to +9007,1992,5474,0991 (Number.MAX_SAFE_INTEGER)
    • support decimal points
    • Simplified Chinese or Traditional Chinese (options: {useTraditional: true})
    • optionally display for positive numbers. (options:{displayPositive: true})
    • optionally use capital (大写). (options: {useCapital: true})
    • optionally remove leading one. (options: {removeLeadingOne: true})
    • optionally use contractions (廿卅卌圩圆进枯桦皕)
    • optionally use traditional units for floating numbers.(分厘毫秒忽微纤沙尘埃渺漠)

Locations

Demo

Source Code

Distributions

Quality

Options and Default values

options: {
  useTraditional: false;
  displayPositive: false;
  useCapital: false;
  removeLeadingOne: false;
  useContractionAll: false;
  useContraction20: false;
  useContraction30: false;
  useContraction40: false;
  useContraction50: false;
  useContraction60: false;
  useContraction70: false;
  useContraction80: false;
  useContraction90: false;
  useContraction200: false;
  useTraditionalFloatingUnit: false;
}

Usage

const NumberToChinese = require('@siakhooi/number-to-chinese-words');
console.log(NumberToChinese.convertNumber(7));

const NumberToChinese = require('@siakhooi/number-to-chinese-words');
console.log(NumberToChinese.convertNumber(7, {useTraditional: true}));

const NumberToChinese = require('@siakhooi/number-to-chinese-words');
console.log(NumberToChinese.convertNumber(7, {displayPositive: true}));

const NumberToChinese = require('@siakhooi/number-to-chinese-words');
console.log(NumberToChinese.convertNumber(7, {useCapital: true}));

const NumberToChinese = require('@siakhooi/number-to-chinese-words');
console.log(NumberToChinese.convertNumber(17, {removeLeadingOne: true}));

const NumberToChinese = require('@siakhooi/number-to-chinese-words');
console.log(NumberToChinese.convertNumber(70, {useContraction70: true}));

Example

Simplified and Traditional

| number | Simplified | Traditional | | ---------------: | ------------------------------------------------------ | ------------------------------------------------------ | | 0 | 零 | 零 | | 17 | 一十七 | 一十七 | | 999 | 九百九十九 | 九百九十九 | | 9999 | 九千九百九十九 | 九千九百九十九 | | 10101 | 一万零一百零一 | 一萬零一百零一 | | 100001 | 一十万零一 | 一十萬零一 | | 3004500 | 三百万四千五百 | 三百萬四千五百 | | 10000001 | 一千万零一 | 一千萬零一 | | 43033039 | 四千三百零三万三千零三十九 | 四千三百零三萬三千零三十九 | | 12345678 | 一千二百三十四万五千六百七十八 | 一千二百三十四萬五千六百七十八 | | 100000000 | 一亿 | 一億 | | 1010101010 | 一十亿一千零一十万一千零一十 | 一十億一千零一十萬一千零一十 | | 10101010101 | 一百零一亿零一百零一万零一百零一 | 一百零一億零一百零一萬零一百零一 | | 999999999999 | 九千九百九十九亿九千九百九十九万九千九百九十九 | 九千九百九十九億九千九百九十九萬九千九百九十九 | | 9007199254740991 | 九千零七兆一千九百九十二亿五千四百七十四万零九百九十一 | 九千零七兆一千九百九十二億五千四百七十四萬零九百九十一 |

display positive

| number | displayPositive=true | displayPositive=false | | -----: | ---------------------- | ----------------------- | | -17 | 负一十七 | 负一十七 | | 17 | 正一十七 | 一十七 |

capital

| number | useCapital=true | useCapital=true,useTraditional=true | | -----: | ----------------- | ------------------------------------- | | -107 | 负壹佰零柒 | 負壹佰零柒 | | 2345 | 贰仟叁佰肆拾伍 | 貳仟參佰肆拾伍 |

remove Leading One

| number | Simplified | Traditional | | ----------: | ------------------------------ | ------------------------------ | | 17 | 十七 | 十七 | | 10101 | 万零一百零一 | 萬零一百零一 | | 100001 | 十万零一 | 十萬零一 | | 10000001 | 千万零一 | 千萬零一 | | 12345678 | 千二百三十四万五千六百七十八 | 千二百三十四萬五千六百七十八 | | 100000000 | 亿 | 億 | | 1010101010 | 十亿一千零一十万一千零一十 | 十億一千零一十萬一千零一十 | | 10101010101 | 百零一亿零一百零一万零一百零一 | 百零一億零一百零一萬零一百零一 |

Decimal Points

| number | Simplified | Traditional | | --------------: | ------------------------------ | ------------------------------ | | 12.13 | 一十二点一三 | 一十二點一三 | | 10.123456789012 | 一十点一二三四五六七八九零一二 | 一十點一二三四五六七八九零一二 |

Contraction

| number | Simplified | Traditional | | -----: | ---------- | ----------- | | 20 | 廿 | 廿 | | 30 | 卅 | 卅 | | 40 | 卌 | 卌 | | 50 | 圩 | 圩 | | 60 | 圆 | 圓 | | 70 | 进 | 進 | | 80 | 枯 | 枯 | | 90 | 桦 | 樺 | | 200 | 皕 | 皕 |

Traditional Floating Unit

| number | Simplified | Traditional | | -------------: | ------------------------------------------------ | ------------------------------------------------ | | 12.13 | 一十二又一分三厘 | 一十二又一分三釐 | | 0.123456789123 | 一分二厘三毫四秒五忽六微七纤八沙九尘一埃二渺三漠 | 一分二釐三毫四秒五忽六微七纖八沙九塵一埃二渺三漠 |

Other Badges

GitHub language count Lines of code GitHub repo size GitHub code size in bytes Workflow workflow workflow Release GitHub release (latest by date) GitHub all releases GitHub Release Date Quality-npms.io npms.io (final) npms.io (final) npms.io (final) npms.io (final) Quality-Sonar Lines of Code Coverage Sonar Violations (short format) Sonar Violations (short format) Sonar Violations (short format) Sonar Violations (short format) Sonar Violations (short format) Sonar Violations (short format) Sonar Violations (long format) Quality-Coveralls Coverage Status Quality-Codecov Codecov Quality-Codacy Codacy Badge Codacy Badge Quality-CodeFactor CodeFactor Quality-Snyk Snyk Vulnerabilities for GitHub Repo Snyk Vulnerabilities for npm package Quality-LGTM LGTM Alerts LGTM Grade Quality-Coverity Coverity Scan