Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

format-money-js

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

format-money-js - npm Package Compare versions

Comparing version 0.2.5 to 0.2.6

2

dist/format-money.d.ts
/*!
* format-money-js v0.2.5
* format-money-js v0.2.6
* (c) 2020 Yurii Derevych

@@ -4,0 +4,0 @@ * Released under the BSD-2-Clause License.

"use strict";
/*!
* format-money-js v0.2.5
* format-money-js v0.2.6
* (c) 2020 Yurii Derevych

@@ -11,3 +11,3 @@ * Released under the BSD-2-Clause License.

this.options = options;
this.version = '0.2.5';
this.version = '0.2.6';
this.defaults = {

@@ -14,0 +14,0 @@ grouping: true,

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});class FormatMoney{constructor(t){this.options=t,this.version="0.2.5",this.defaults={grouping:!0,separator:",",decimalPoint:".",decimals:0,prefix:"",suffix:""},this.from=(t=>{const s=t<0?"-":"";let i,o,e,n,r;if(i=Math.abs(t).toFixed(this.options.decimals),e=(o=(i+="").split("."))[0],n=o.length>1?this.options.decimalPoint+o[1]:"",this.options.grouping){r="";for(let t=0,s=e.length;t<s;++t)0!==t&&t%3==0&&(r=this.options.separator+r),r=e[s-t-1]+r;e=r}return s+this.options.prefix+e+n+this.options.suffix}),this.options=Object.assign(Object.assign({},this.defaults),t)}}exports.FormatMoney=FormatMoney;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});class FormatMoney{constructor(t){this.options=t,this.version="0.2.6",this.defaults={grouping:!0,separator:",",decimalPoint:".",decimals:0,prefix:"",suffix:""},this.from=(t=>{const s=t<0?"-":"";let i,o,e,n,r;if(i=Math.abs(t).toFixed(this.options.decimals),e=(o=(i+="").split("."))[0],n=o.length>1?this.options.decimalPoint+o[1]:"",this.options.grouping){r="";for(let t=0,s=e.length;t<s;++t)0!==t&&t%3==0&&(r=this.options.separator+r),r=e[s-t-1]+r;e=r}return s+this.options.prefix+e+n+this.options.suffix}),this.options=Object.assign(Object.assign({},this.defaults),t)}}exports.FormatMoney=FormatMoney;

@@ -1,5 +0,7 @@

// ES6
import { FormatMoney } from './dist/FormatMoney.js'
const { FormatMoney } = require('format-money-js');
const fm = new FormatMoney({decimals: 2});
console.log(fm.from(12345.67));
const fm = new FormatMoney({
decimals: 2,
prefix: '$'
});
console.log(fm.from(12345.67)); // $12,345.67
{
"name": "format-money-js",
"description": "Tiny JavaScript library by CurrencyRate.today, providing simple and advanced number, money and currency formatting.",
"version": "0.2.5",
"version": "0.2.6",
"license": "BSD-2-Clause",

@@ -6,0 +6,0 @@ "main": "index.js",

@@ -11,4 +11,7 @@ # format-money-js

const fm = new FormatMoney({decimals: 2});
console.log(fm.from(12345.67));
const fm = new FormatMoney({
decimals: 2,
prefix: '$'
});
console.log(fm.from(12345.67)); // $12,345.67
```
/*!
* format-money-js v0.2.5
* format-money-js v0.2.6
* (c) 2020 Yurii Derevych

@@ -18,3 +18,3 @@ * Released under the BSD-2-Clause License.

version = '0.2.5';
version = '0.2.6';
private defaults: FormatMoneyOptions = {

@@ -21,0 +21,0 @@ grouping: true,

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc