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

xmcurrency

v1.0.5

Published

人民币处理类, 编译生成的版本是ES2015

Downloads

1

Readme

人民币处理类

历史版本

  • 2022-07-06 1.0.5
      • 消除lodash的缺陷警告
  • 2022-03-04 1.0.4
      • 去除不必要的说明
  • 2022-03-07 1.0.3
      • 更新依赖包的版本
  • 2021-05-06 1.0.2
      • 去除工程中的临时文件。
  • 2021-05-06 1.0.1
      • 更新依赖的lodash的版本

目标版本是 ES2015 请确认运行环境是否支持ES2015

  • github: https://github.com/zdhsoft/xmcurrency
  • npm: https://www.npmjs.com/package/xmcurrency

示例代码

let m = [];
let c = new XMCurrency(-12345);
m.push(c);
m.push(c.add(109999));
m.push(c.sub(10));
m.push(c.div(0.01));
m.push(c.mul(10));
m.push(c.mul(0.01));

let tt = new XMCurrency(0);
tt.selfAdd(2805307.04);
tt.selfAdd(4323515.28);
tt.selfAdd(2805307.04);
tt.selfAdd(3281107.13);
m.push(tt);


for(let mm of m) {
    console.log(mm.value, mm.intValue, mm.toString(), mm.format(true, true), mm.Chinese());
}

//输出结果
//-12345 -1234500 -12345.00 ¥-1,2345.00 负壹万贰仟叁佰肆拾伍元整
//97654 9765400 97654.00 ¥9,7654.00 玖万柒仟陆佰伍拾肆元整
//-12355 -1235500 -12355.00 ¥-1,2355.00 负壹万贰仟叁佰伍拾伍元整
//-1234500 -123450000 -1234500.00 ¥-123,4500.00 负壹佰贰拾叁万肆仟伍佰元整
//-123450 -12345000 -123450.00 ¥-12,3450.00 负拾贰万叁仟肆佰伍拾元整
//-123.45 -12345 -123.45 ¥-123.45 负壹佰贰拾叁元肆角伍分
//13215236.49 1321523649 13215236.49 ¥1321,5236.49 壹仟叁佰贰拾壹万伍仟贰佰叁拾陆元肆角玖分