Socket
Socket
Sign inDemoInstall

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 1.1.4 to 1.1.5

2

dist/format-money.d.ts
/*!
* format-money-js v1.1.4
* format-money-js v1.1.5
* (c) 2020 Yurii Derevych

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

"use strict";
/*!
* format-money-js v1.1.4
* format-money-js v1.1.5
* (c) 2020 Yurii Derevych

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

this.options = options;
this.version = '1.1.4';
this.version = '1.1.5';
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="1.1.4",this.defaults={grouping:!0,separator:",",decimalPoint:".",decimals:0,prefix:"",suffix:""},this.from=((t,s)=>{s=Object.assign(Object.assign({},this.options),s);const e=t<0?"-":"";let i,o,r,a,n;if(i=Math.abs(t).toFixed(s.decimals),r=(o=(i+="").split("."))[0],a=o.length>1?s.decimalPoint+o[1]:"",s.grouping){n="";for(let t=0,e=r.length;t<e;++t)0!==t&&t%3==0&&(n=s.separator+n),n=r[e-t-1]+n;r=n}return e+s.prefix+r+a+s.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="1.1.5",this.defaults={grouping:!0,separator:",",decimalPoint:".",decimals:0,prefix:"",suffix:""},this.from=((t,s)=>{s=Object.assign(Object.assign({},this.options),s);const e=t<0?"-":"";let i,o,r,a,n;if(i=Math.abs(t).toFixed(s.decimals),r=(o=(i+="").split("."))[0],a=o.length>1?s.decimalPoint+o[1]:"",s.grouping){n="";for(let t=0,e=r.length;t<e;++t)0!==t&&t%3==0&&(n=s.separator+n),n=r[e-t-1]+n;r=n}return e+s.prefix+r+a+s.suffix}),this.options=Object.assign(Object.assign({},this.defaults),t)}}exports.FormatMoney=FormatMoney;
{
"name": "format-money-js",
"description": "Tiny JavaScript library (656 bytes) by CurrencyRate.today, providing simple and advanced number, money and currency formatting.",
"version": "1.1.4",
"version": "1.1.5",
"license": "BSD-2-Clause",

@@ -6,0 +6,0 @@ "main": "./dist/format-money.js",

@@ -23,2 +23,11 @@ # format-money-js

| Name | Default | Type | Example
|---------------|----------|---------|------------------------------|
| grouping | true | Boolean | 1,000 (true) vs 1000 (false) |
| separator | , | String | 1,000 |
| decimalPoint | . | String | 1,234.56 |
| decimals | 0 | Number | 1,234 (0 - without decimals) |
| prefix | None | String | $1,234.56 (before) |
| suffix | None | String | 1,234.56$ (after) |
You can added options in construct of class and in method. But method will be primary.

@@ -32,9 +41,4 @@ ### Example:

| Name | Default | Type | Example
|---------------|----------|---------|------------------------------|
| grouping | true | Boolean | 1,000 (true) vs 1000 (false) |
| separator | , | String | 1,000 |
| decimalPoint | . | String | 1,234.56 |
| decimals | 0 | Number | 1,234 (0 - without decimals) |
| prefix | None | String | $1,234.56 (before) |
| suffix | None | String | 1,234.56$ (after) |
## Thank you
https://currencyrate.today/
/*!
* format-money-js v1.1.4
* format-money-js v1.1.5
* (c) 2020 Yurii Derevych

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

version = '1.1.4';
version = '1.1.5';
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