You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

nextalys-js-helpers

Package Overview
Dependencies
Maintainers
1
Versions
450
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nextalys-js-helpers - npm Package Compare versions

Comparing version

to
0.2.111

34

dist/helpers/main-helpers.js

@@ -74,14 +74,42 @@ "use strict";

return '';
var parsedNumber = value;
if (typeof value === 'string') {
parsedNumber = parseFloat(value);
}
var strValue = value.toString();
if (strValue.indexOf('.') !== -1) {
var arr = strValue.split('.');
var rightPart = arr[1];
if (decimals != null) {
rightPart = this.padRight(arr[1], decimals, '0');
}
rightPart = rightPart.replace(/ /g, "");
if (decimals != null && rightPart.length > decimals) {
parsedNumber = MainHelpers.round(parsedNumber, decimals);
}
}
strValue = parsedNumber.toString();
strValue = strValue.replace(/ /g, "");
strValue = strValue.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
if (decimals && (strValue.indexOf('.') !== -1 || forceDecimals)) {
if (strValue.indexOf('.') !== -1 || forceDecimals) {
var leftPart = void 0;
var rightPart = void 0;
if (strValue.indexOf('.') !== -1) {
var arr = strValue.split('.');
strValue = arr[0] + '.' + this.padRight(arr[1], decimals, '0');
leftPart = arr[0];
rightPart = arr[1];
if (decimals != null) {
rightPart = this.padRight(rightPart, decimals, '0');
}
}
else {
leftPart = strValue;
//force decimals
strValue = strValue + '.' + this.padRight('', decimals, '0');
if (decimals == null) {
decimals = 2;
}
rightPart = this.padRight('', decimals, '0');
}
rightPart = rightPart.replace(/ /g, "");
strValue = leftPart + '.' + rightPart;
}

@@ -88,0 +116,0 @@ return strValue;

2

package.json
{
"name": "nextalys-js-helpers",
"version": "0.2.110",
"version": "0.2.111",
"description": "Nextalys Javascript Helpers",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet