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

rmb-capital-js

v0.0.6

Published

阿拉伯数字金额转为汉字大写

Downloads

26

Readme

Convert RMB amount to Chinese uppercase.



将阿拉伯金额数字转换为汉字大写形式。


使用

npm i rmb-capital
import { rmbCapital } from "rmb-capital";

console.log(rmbCapital(123456789.01));
// 人民币壹亿贰仟叁佰肆拾伍万陆仟柒佰捌拾玖元零壹分

在转换前一定确保数字的正确性。最大金额到万亿级。

在浏览器

<script src="./dist/rmb-capital.min.js"></script>
<script>
console.log(rmbCapital(123456789.01));
</script>

规范

详查 《会计基础工作规范》,此处总结性的罗列关键点。

  • 所有以元为单位
  • 汉字大写数字金额如:零、壹、贰、叁、肆、伍、陆、柒、捌、玖、拾、佰、仟、万、亿等
  • 大写金额数字到元或者角为止的,在“元”或者“角”字之后应当写“整”字或者“正”字(本项目使用“整”),大写金额数字有分的,分字后面不写“整”或者“正”字
  • 大写金额数字前未印有货币名称的,应当加填货币名称,即“人民币”,货币名称与金额数字之间不得留有空白
  • 阿拉伯金额数字中间有“0”时,汉字大写金额要写“零”字
  • 阿拉伯数字金额中间连续有几个“0”时,汉字大写金额中可以只写一个“零”字; 阿拉伯金额数字元位是“0”,或者数字中间连续有几个“0”、元位也是“0”但角位不是 “0”时,汉字大写金额可以只写一个“零”字,也可以不写“零”字

其它版本

License

The MIT License (MIT). Please see License File for more information.