Socket
Socket
Sign inDemoInstall

@nlo/currency-formatter

Package Overview
Dependencies
Maintainers
8
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nlo/currency-formatter - npm Package Compare versions

Comparing version 1.1.3 to 1.1.4

23

dist/currency-formatter.js

@@ -7,4 +7,13 @@ "use strict";

// The currency style isn't used here because it requires a currency and we don't want to prefix with a € sign
this.userFormatter = new Intl.NumberFormat('nl-NL', { style: 'decimal', minimumFractionDigits: 2, maximumFractionDigits: 2 });
this.gtmFormatter = new Intl.NumberFormat('us-US', { useGrouping: false, style: 'decimal', minimumFractionDigits: 2, maximumFractionDigits: 2 });
this.userFormatter = new Intl.NumberFormat("nl-NL", {
style: "decimal",
minimumFractionDigits: 2,
maximumFractionDigits: 2,
});
this.gtmFormatter = new Intl.NumberFormat("us-US", {
useGrouping: false,
style: "decimal",
minimumFractionDigits: 2,
maximumFractionDigits: 2,
});
}

@@ -16,3 +25,3 @@ /* @deprecated from of 7-2-2023, it's still used in production environments

if (allowNegative === void 0) { allowNegative = true; }
var cents = typeof inputCents === 'string' ? parseInt(inputCents, 10) : inputCents;
var cents = typeof inputCents === "string" ? parseInt(inputCents, 10) : inputCents;
if (isNaN(cents) || this.isUnsafeInteger(cents)) {

@@ -34,10 +43,10 @@ return;

var money = this.formatCents(cents, allowNegative);
return money ? money.replace(',00', '') : money;
return money ? money.replace(",00", "") : money;
};
CurrencyFormatter.prototype.formatCentsForText = function (cents, allowNegative) {
var money = this.formatCents(cents, allowNegative);
return money ? money.replace(',00', ',-') : money;
return money ? money.replace(",00", ",-") : money;
};
CurrencyFormatter.prototype.formatEuroToCents = function (euro) {
var moneyStr = euro.replace(/\./g, '').replace(/,/g, '.');
var moneyStr = euro.replace(/\./g, "").replace(/,/g, ".");
var money = parseFloat(moneyStr);

@@ -54,3 +63,3 @@ if (isNaN(money)) {

}
return (integer > maxSafeInteger);
return integer > maxSafeInteger;
};

@@ -57,0 +66,0 @@ return CurrencyFormatter;

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

import currencyFormatter from './currency-formatter';
import currencyFormatter from "./currency-formatter";
export default currencyFormatter;
{
"name": "@nlo/currency-formatter",
"version": "1.1.3",
"description": "",
"main": "dist/index.js",
"keywords": [],
"author": "",
"files": [
"dist/",
"package.json"
],
"scripts": {
"build": "tsc --build",
"watch": "tsc --watch",
"test": "jest"
},
"devDependencies": {
"@types/jest": "^29.5.1",
"@types/node": "^13.13.5",
"jest": "29.3.1",
"jest-environment-jsdom": "29.3.1",
"ts-jest": "29.0.3",
"typescript": "4.9.4"
},
"publishConfig": {
"access": "public"
},
"gitHead": "b5bd12a26dab6c13b8fae115454ed609abc671c3"
"name": "@nlo/currency-formatter",
"version": "1.1.4",
"description": "",
"main": "dist/index.js",
"keywords": [],
"author": "",
"files": [
"dist/",
"package.json"
],
"scripts": {
"build": "tsc --build",
"watch": "tsc --watch",
"test": "jest"
},
"devDependencies": {
"@types/jest": "^29.5.1",
"@types/node": "^13.13.5",
"jest": "29.3.1",
"jest-environment-jsdom": "29.3.1",
"ts-jest": "29.0.3",
"typescript": "4.9.4"
},
"publishConfig": {
"access": "public"
},
"gitHead": "b2d6ec7a784d60350da52475f0d745216b825a2d"
}
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