Socket
Socket
Sign inDemoInstall

xmcurrency

Package Overview
Dependencies
1
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    xmcurrency

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


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

人民币处理类

历史版本

  • 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 壹仟叁佰贰拾壹万伍仟贰佰叁拾陆元肆角玖分

Keywords

FAQs

Last updated on 06 Jul 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc